Can you turn on the trace :

<property name="openjpa.Log" value="File=c:/trace.log, DefaultLevel=TRACE" />

and attach the trace file for further investigation?

-Fay

--- On Thu, 4/16/09, Georgi Naplatanov <go...@oles.biz> wrote:

> From: Georgi Naplatanov <go...@oles.biz>
> Subject: Optimistic locking errors were detected when flushing to the data 
> store
> To: users@openjpa.apache.org
> Date: Thursday, April 16, 2009, 12:36 PM
> Hello list.
> 
> I upgraded OpenJPA from 1.2.0 to 1.2.1 and have the
> following exception.
> My environment is MySql 5.0.51 (MyISAM storage manager) and
> JRE Sun
> 1.6.0_13-b03. The application works without this exception
> with OpenJPA
> 1.2.0.
> 
> Optimistic locking errors were detected when flushing to
> the data store.
>  The following objects may have been concurrently modified
> in another
> transaction:
> [org.opencms.db.jpa.persistence.CmsDAOOfflineResources-3e51ea18-2abb-11de-93fb-4b60ca370499]
> <openjpa-1.2.1-r752877:753278 fatal store error>
> org.apache.openjpa.persistence.RollbackException:
> Optimistic locking
> errors were detected when flushing to the data store. 
> The following
> objects may have been concurrently modified in another
> transaction:
> [org.opencms.db.jpa.persistence.CmsDAOOfflineResources-3e51ea18-2abb-11de-93fb-4b60ca370499]
>     at
> org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:523)
>     at
> org.opencms.db.jpa.CmsDbContext.commitAndClose(CmsDbContext.java:129)
>     at
> org.opencms.db.jpa.CmsDbContext.clear(CmsDbContext.java:73)
>     at
> org.opencms.db.CmsSecurityManager.publishProject(CmsSecurityManager.java:3107)
>     at
> org.opencms.publish.CmsPublishManager.publishProject(CmsPublishManager.java:501)
>     at
> org.opencms.publish.CmsPublishManager.publishProject(CmsPublishManager.java:525)
>     at
> org.opencms.publish.CmsPublishManager.publishResource(CmsPublishManager.java:563)
>     at
> org.opencms.file.TestPublishIssues.testPublishFolderWithDeletedFileFromOtherProject(TestPublishIssues.java:335)
>     at
> junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
>     at
> junit.extensions.TestSetup$1.protect(TestSetup.java:19)
>     at
> junit.extensions.TestSetup.run(TestSetup.java:23)
> Caused by: <openjpa-1.2.1-r752877:753278 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.opencms.db.jpa.persistence.CmsDAOOfflineResources-3e51ea18-2abb-11de-93fb-4b60ca370499]
>     at
> org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2160)
>     at
> org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2010)
>     at
> org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
>     at
> org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1826)
>     at
> org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
>     at
> org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1350)
>     at
> org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:877)
>     at
> org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:512)
> Caused by: <openjpa-1.2.1-r752877:753278 nonfatal store
> error>
> org.apache.openjpa.persistence.OptimisticLockException: An
> optimistic
> lock violation was detected when flushing object instance
> "org.opencms.db.jpa.persistence.CmsDAOOfflineResources-3e51ea18-2abb-11de-93fb-4b60ca370499"
> to the data store.  This indicates that the object was
> concurrently
> modified in another transaction.
> FailedObject:
> org.opencms.db.jpa.persistence.CmsDAOOfflineResources-3e51ea18-2abb-11de-93fb-4b60ca370499
>     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: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)
>     at
> org.apache.openjpa.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:562)
>     at
> org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
> 
> Best regards
> Georgi
> 



Reply via email to