users@glassfish.java.net

Re: glassFishv2ur2:JDO76406: Concurrent access exception:

From: Mitesh Meswani <Mitesh.Meswani_at_Sun.COM>
Date: Mon, 12 May 2008 22:24:02 -0700

Looks like you are having multiple transactions running in parallel and
one of the transactions is deleting an entity that other transaction is
trying to update. Please check logic of your sessions beans.

glassfish_at_javadesktop.org wrote:
> i am using for study the Sun Adventure Builder Blueprint app - version adventure1.0.5. This is a j2ee 1.4 app making use of web services, session beans - both Stateful, Stateless, and Entity beans. i think this is EJB2.1 code.
>
> The error i am trying to fully understand occurs both with the "stock" AB code and the code i've been making experimental/learning mods to. It occurs less often , but still occurs if i change 1 particular Session bean from Stateless to Stateful.
>
> stack trace of the error msg at end of this discussion.
>
> as best as i can tell -- and i dont know if this is ok according to the EJB spec or not? -- there seem to end up being 2 separate instances of an entity bean with context such that both are referencing the same "findByPrimaryKey" at the same time. again -- as best as i can tell -- it is when both of these instances are doing some kind of update (ejbStore) in the domain1/generated/ejb/j2ee-apps code.
>
> the AB code uses CMP, i am testing with GFv2ur2, and my ide is nb61;
>
> any help in understand how/why this error occurs and if its a real error? also would be appreciated.
>
> why does glassfish create 2 entity beans referencing same data? is this allowed ?
>
> all the code make a "findByPrimaryKey" method call before the -- ie setStatus(pk) call;
>
> thanks
> gary
>
>
>
> stack trace excerpt:
> EJB5071: Some remote or transactional roll back exception occurred
> com.sun.jdo.api.persistence.support.JDODataStoreException: JDO76406: Concurrent access exception: object to update has been updated or deleted by another transaction.
> FailedObjectArray: [com.sun.j2ee.blueprints.processmanager.manager.ejb.ManagerBean_838477572_JDOSta]
> at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.throwJDOConcurrentAccessException(SQLStoreManager.java:657)
> at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.executeUpdate(SQLStoreManager.java:216)
> at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.execute(SQLStoreManager.java:137)
> at com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.updatePersistent(SQLStateManager.java:924)
> at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.flushToDataStore(PersistenceManagerImpl.java:1499)
> at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.flushTxCache(PersistenceManagerImpl.java:1426)
> at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.beforeCompletion(PersistenceManagerImpl.java:1360)
> at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.notifyBeforeCompletion(TransactionImpl.java:1151)
> at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.commitBefore(TransactionImpl.java:790)
> at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.beforeCompletion(TransactionImpl.java:681)
> at com.sun.ejb.containers.ContainerSynchronization.beforeCompletion(ContainerSynchronization.java:167)
> at com.sun.jts.jta.SynchronizationImpl.before_completion(SynchronizationImpl.java:99)
> at com.sun.jts.CosTransactions.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:158)
> at com.sun.jts.CosTransactions.TopCoordinator.beforeCompletion(TopCoordinator.java:2548)
> at com.sun.jts.CosTransactions.CoordinatorTerm.commit(CoordinatorTerm.java:278)
> at com.sun.jts.CosTransactions.TerminatorImpl.commit(TerminatorImpl.java:249)
> at com.sun.jts.CosTransactions.CurrentImpl.commit(CurrentImpl.java:623)
> at com.sun.jts.jta.TransactionManagerImpl.commit(TransactionManagerImpl.java:309)
> at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.commit(J2EETransactionManagerImpl.java:1004)
> at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:397)
> at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3792)
> at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3571)
> at com.sun.ejb.containers.MessageBeanContainer.afterMessageDeliveryInternal(MessageBeanContainer.java:1226)
> at com.sun.ejb.containers.MessageBeanContainer.afterMessageDelivery(MessageBeanContainer.java:1197)
> at com.sun.ejb.containers.MessageBeanListenerImpl.afterMessageDelivery(MessageBeanListenerImpl.java:79)
> at com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:139)
> at $Proxy216.afterDelivery(Unknown Source)
> at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:324)
> at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:76)
> at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
> ===================================
> com.sun.ejb.containers.EntityContextImpl_at_1455cd6:ManagerBean:ejbPassivate:AB-j2ee-1210363509843
> com.sun.ejb.containers.MessageBeanContextImpl_at_1323b78:WorkFlowManagerBean:onMessage:begin
> MDB00037: [opc:WorkFlowManagerBean]: Message-driven bean invocation exception: [javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException]
> javax.ejb.EJBException
> javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException
> javax.transaction.RollbackException
> at com.sun.jts.jta.TransactionManagerImpl.commit(TransactionManagerImpl.java:311)
> at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.commit(J2EETransactionManagerImpl.java:1004)
> at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:397)
> at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3792)
> at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3571)
> at com.sun.ejb.containers.MessageBeanContainer.afterMessageDeliveryInternal(MessageBeanContainer.java:1226)
> at com.sun.ejb.containers.MessageBeanContainer.afterMessageDelivery(MessageBeanContainer.java:1197)
> at com.sun.ejb.containers.MessageBeanListenerImpl.afterMessageDelivery(MessageBeanListenerImpl.java:79)
> at com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:139)
> at $Proxy216.afterDelivery(Unknown Source)
> at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:324)
> at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:76)
> at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
> javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException
> at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3798)
> at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3571)
> at com.sun.ejb.containers.MessageBeanContainer.afterMessageDeliveryInternal(MessageBeanContainer.java:1226)
> at com.sun.ejb.containers.MessageBeanContainer.afterMessageDelivery(MessageBeanContainer.java:1197)
> at com.sun.ejb.containers.MessageBeanListenerImpl.afterMessageDelivery(MessageBeanListenerImpl.java:79)
> at com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:139)
> at $Proxy216.afterDelivery(Unknown Source)
> at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:324)
> at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:76)
> at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
> [Message sent by forum member 'emiddio' (emiddio)]
>
> http://forums.java.net/jive/thread.jspa?messageID=273586
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>