Hi Sargol,

Is the timeout exception occuring every time while executing UPDATE statement 
or only sometimes?

If it is permanent, maybe you have not configured the XA transaction 
coordinator properly. In this case I would ask on a GlassFish forum.

If it happens only from time to time, your application might be causing 
deadlocks. One common deadlock scenario is when you have two tables and two 
threads are updating them but each thread updates them in a different order.

What is (are) the other resource which participates in your XA transaction? 
Maybe the other resource performs slowly or even blocks causing the XA 
transaction timing out.

Cheers,
Milosz

> Hi Milosz , 
> 
> Thank you for your reply. 
> The sql log statements are enabled and I don't have any SELECT FOR UPDATE
> statements
> and there is an UPDATE statement so I can make sure that openjpa does not
> use pessimistic transaction.
> 
> So, how can I find that for what reason the transaction has not been
> commited and why this exception has been raised.
> 
> 
> Here is the stack trace. It would be grateful if you could help me. 
>    
> 
> Regards, 
> Sargol
> 
> >>>>>>>> Stack trace <<<<<<<<<<<<
> 
>  <openjpa-1.2.1-r752877:753278 nonfatal general error>
> org.apache.openjpa.persistence.PersistenceException: ORA-02049: timeout:
> distributed transaction waiting for lock
>  {prepstmnt 1631220936 UPDATE GC1ACCOUNT SET G1004BAL = ?, G1004VER = ?,
> TRCVER = ? WHERE G1004ID = ? AND TRCVER = ? [params=(double) 1902345.0,
> (double) 1296.0, (int) 1297, (long) 65996, (int) 1296]} [code=2049,
> state=42000]
> FailedObject:
> com.kishware.core.gl.data.Account-com.kishware.core.gl.data.Account-65996
>       at 
> org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4232)
>       at
> org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4197)
>       at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
>       at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:72)
>       at
> org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:131)
>       at
> org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:82)
>       at
> org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:89)
>       at
> org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:72)
>       at
> org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
>       at
> org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:106)
>       at
> org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:59)
>       at
> org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
>       at
> org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
>       at
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:717)
>       at
> org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
>       ... 152 more
> Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ORA-02049:
> timeout: distributed transaction waiting for lock
>  {prepstmnt 1631220936 UPDATE GC1ACCOUNT SET G1004BAL = ?, G1004VER = ?,
> TRCVER = ? WHERE G1004ID = ? AND TRCVER = ? [params=(double) 1902345.0,
> (double) 1296.0, (int) 1297, (long) 65996, (int) 1296]} [code=2049,
> state=42000]
>       at
> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:192)
>       at
> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:57)
>       at
> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:866)
>       at
> org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
>       at
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1586)
>       at
> org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:151)
>       at
> org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:120)
>       ... 162 more

Reply via email to