users@glassfish.java.net

Re: distributed transaction waiting for lock

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Tue, 15 Feb 2011 11:24:58 -0800

This seems like on OpenJPA setup issue. Please ask on their forum for
advise.

-marina

Sargol wrote:
> Hello
> We have configured a distributed transaction in our application server and
> we are using openjpa 1.2.1 and Glassfish application server. Although the
> default behavior of transaction locking must be optimistic,
> it seems that pessimistic locking has been happened.
> It is found that Row Lock contention happens in a specific table.
> This is the exception :
> java.sql.SQLException: ORA-02049: timeout: distributed transaction waiting
> for lock
>
> For your information, already all the following properties have been set.
>
> 1. <persistence-unit name="JPXA" transation-type="JTA">
>
> 2. <property name="openjpa.TransactionMode" value="managed"/>
>
> 3. <property name="openjpa.ManagedRuntime"
>
> value="jndi(TransactionManagerName=java:appserver/TransactionManager)"/>
>
>
> Following searching about this locking problem, we found that we should add
> two more properties for openjpa as listed below.
>
> <property name="openjpa.LockManager" value="version" />
> <property name="openjpa.jdbc.TransactionIsolation" value="read-committed" />
>
>
> but this time we have got another error:
> org.apache.openjpa.persistence.PersistenceException: ORA-02089: COMMIT is
> not allowed in a subordinate session.
>
> Thanks for any help.
>
> Regards,
> Sargol
>
>