openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <d...@iq80.com>
Subject What causes an optimistic exception?
Date Thu, 04 Jan 2007 18:29:32 GMT
I'm getting this exception printed to my log, but my tests work.  Is  
my test doing something wrong?

<2|false|0.9.6-incubating>  
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.openejb.test.entity.cmr.onetoone.ABean_JPA@2c4eaa]
         at org.apache.openjpa.kernel.BrokerImpl.newFlushException 
(BrokerImpl.java:2077)
         at org.apache.openjpa.kernel.BrokerImpl.flush 
(BrokerImpl.java:1927)
         at org.apache.openjpa.kernel.BrokerImpl.flushSafe 
(BrokerImpl.java:1825)
         at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion 
(BrokerImpl.java:1756)
         at org.apache.openejb.core.TransactionManagerWrapper 
$TransactionWrapper.beforeCompletion(TransactionManagerWrapper.java:194)
         at  
org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion 
(TransactionImpl.java:515)
         at  
org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare 
(TransactionImpl.java:399)
         at  
org.apache.geronimo.transaction.manager.TransactionImpl.commit 
(TransactionImpl.java:256)
         at  
org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit 
(TransactionManagerImpl.java:264)
         at org.apache.openejb.core.TransactionManagerWrapper.commit 
(TransactionManagerWrapper.java:58)
         at  
org.apache.openejb.test.entity.cmr.AbstractCMRTest.completeTransaction 
(AbstractCMRTest.java:57)
         at  
org.apache.openejb.test.entity.cmr.OneToOneTests.test07_BSetAExistingBNe 
wA(OneToOneTests.java:154)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke 
(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.openejb.test.NumberedTestCase.runTestMethod 
(NumberedTestCase.java:135)
         at org.apache.openejb.test.NumberedTestCase$1.protect 
(NumberedTestCase.java:120)
         at junit.framework.TestResult.runProtected(TestResult.java:128)
         at org.apache.openejb.test.NumberedTestCase.run 
(NumberedTestCase.java:123)
         at org.apache.openejb.test.NumberedTestCase.run 
(NumberedTestCase.java:102)
         at org.apache.openejb.test.TestSuite.run(TestSuite.java:46)
         at org.apache.openejb.test.TestSuite.run(TestSuite.java:46)
         at org.apache.openejb.test.TestSuite.run(TestSuite.java:46)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke 
(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.maven.surefire.junit.JUnitTestSet.execute 
(JUnitTestSet.java:210)
         at  
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSe 
t(AbstractDirectoryTestSuite.java:135)
         at  
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute 
(AbstractDirectoryTestSuite.java:160)
         at org.apache.maven.surefire.Surefire.run(Surefire.java:81)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke 
(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at  
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess 
(SurefireBooter.java:182)
         at org.apache.maven.surefire.booter.SurefireBooter.main 
(SurefireBooter.java:743)
Caused by: <2|false|0.9.6-incubating>  
org.apache.openjpa.util.OptimisticException: An optimistic lock  
violation was detected when flushing object instance  
"org.apache.openejb.test.entity.cmr.onetoone.ABean_JPA@2c4eaa" to the  
data store.  This indicates that the object was concurrently modified  
in another transaction.
FailedObject:  
org.apache.openejb.test.entity.cmr.onetoone.ABean_JPA@2c4eaa
         at  
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInterna 
l(PreparedStatementManagerImpl.java:96)
         at  
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush 
(PreparedStatementManagerImpl.java:68)
         at  
org.apache.openjpa.jdbc.kernel.OperationOrderUpdateManager.flushPrimaryR 
ow(OperationOrderUpdateManager.java:200)
         at  
org.apache.openjpa.jdbc.kernel.OperationOrderUpdateManager.flush 
(OperationOrderUpdateManager.java:86)
         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush 
(AbstractUpdateManager.java:86)
         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush 
(AbstractUpdateManager.java:69)
         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush 
(JDBCStoreManager.java:511)
         at org.apache.openjpa.kernel.DelegatingStoreManager.flush 
(DelegatingStoreManager.java:127)
         ... 37 more


Mime
View raw message