You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ode.apache.org by Matthieu Riou <ma...@gmail.com> on 2009/04/02 16:48:03 UTC

Re: org.apache.openjpa.util.OptimisticException: Optimistic locking errors were detected when flushing to the data store

On Thu, Apr 2, 2009 at 6:33 AM, Matheswaran Nachimuthu <
matheswaran_n@infosys.com> wrote:

>
> Hi,
>
> As you have already suggested, i have migrated from Ode 1.1.1 to ode1.2 and
> the backend is MySQL 3.23 When we give one request, then it is working fine
> but if we give 15-20 parallel request to the orch engine. Then we get the
> OptimisticLock exception. Please help me out to narrow down to the issue.
>

I think you wouldn't have this problem using what's in the 1.x branch right
now instead of 1.2. Would you be able to build from the branch source or do
you need binaries?

Matthieu


>
> Thanks in Advance!
>
> Regards,
> Matheswaran N
>
>
> Stacktrace :
>
>
> MESSAGE: Not Authenticated
> 2009-04-01 11:52:44,473 [openjpa.Runtime] -An exception occurred while
> ending the transaction.  This exception will be re-thrown.
> <openjpa-1.1.0-r422266:657916 nonfatal store error>
> org.apache.openjpa.util.OptimisticException: Optimistic locking errors were
> detected when flushing to the data store.  The following objects may have
> been concurrently modified in another transaction:
>
> [org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-668]
>        at
>
> org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2157)
>        at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2007)
>        at
> org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1905)
>        at
> org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1823)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:498)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:257)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>        at
>
> org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>        at
>
> org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>        at
>
> org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>        at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>        at java.lang.Thread.run(Thread.java:595)
> Caused by: <openjpa-1.1.0-r422266:657916 nonfatal store error>
> org.apache.openjpa.util.OptimisticException: An optimistic lock violation
> was detected when flushing object instance
>
> "org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-668"
> to the data store.  This indicates that the object was concurrently
> modified
> in another transaction.
> FailedObject:
>
> org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-668
>        at
>
> org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:124)
>        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:119)
>        at
>
> org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:56)
>        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:549)
>        at
>
> org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
>        ... 16 more
> 2009-04-01 11:52:44,477 [Transaction] -Unexpected exception from
> beforeCompletion; transaction will roll back
> <openjpa-1.1.0-r422266:657916 nonfatal store error>
> org.apache.openjpa.persistence.OptimisticLockException: Optimistic locking
> errors were detected when flushing to the data store.  The following
> objects
> may have been concurrently modified in another transaction:
>
> [org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-668]
>        at
>
> org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2157)
>        at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2007)
>        at
> org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1905)
>        at
> org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1823)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:498)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:257)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>        at
>
> org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>        at
>
> org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>        at
>
> org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>        at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>        at java.lang.Thread.run(Thread.java:595)
>
> --
> View this message in context:
> http://www.nabble.com/org.apache.openjpa.util.OptimisticException%3A-Optimistic-locking-errors-were-detected-when-flushing-to-the-data-store-tp22847957p22847957.html
> Sent from the Apache Ode Dev mailing list archive at Nabble.com.
>
>