0 Replies Latest reply on Aug 28, 2008 9:57 AM by Alexandre Pretyman

    Container Managed EntityManager returns no helpful stacktrac

    Alexandre Pretyman Newbie

      Hi,

      I am using a Container managed EntityManager on a Stateful session bean, and after a random time
      it has been processing, it throws me a JDBCException regarding a deadlock, however it gives me
      no information on my code of what could have caused it....

      I am new to JBoss + EJB development and frankly, don't know how to proceed debugging this.

      Anyone has any clues?

      Thank you

      The stack trace is below. I am using JBoss 4.2.2.


      09:52:02,431 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
      09:52:02,431 ERROR [JDBCExceptionReporter] Batch entry 10 update MovingObject set lastTlmtr=<stream of 10145 bytes>, beforeLastTlmtr=<stream of 10145 bytes>, tlmtrLst=<stream of 90505 bytes>, lastPnt=SRID=4326;POINT(-43.31917190551758 -23.012861251831055), badMetricCounter=0 where movingObjectId=112 was aborted. Call getNextException to see the cause.
      09:52:02,431 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: 40P01
      09:52:02,431 ERROR [JDBCExceptionReporter] ERROR: deadlock detected
       Detail: Process 5360 waits for ShareLock on transaction 15510843; blocked by process 5381.
      Process 5381 waits for ShareLock on transaction 15510842; blocked by process 5360.
      09:52:02,432 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
      org.hibernate.exception.GenericJDBCException: could not update: [frota.entities.MovingObject#101]
       at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2425)
       at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2307)
       at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2607)
       at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:92)
       at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:142)
       at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
       at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
       at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:515)
       at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)
       at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)
       at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)
       at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
       at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
       at org.jboss.resource.adapter.jms.inflow.JmsServerSession$XATransactionDemarcationStrategy.end(JmsServerSession.java:494)
       at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:248)
       at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
       at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
       at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:761)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.sql.BatchUpdateException: Batch entry 10 update MovingObject set lastTlmtr=<stream of 10145 bytes>, beforeLastTlmtr=<stream of 10145 bytes>, tlmtrLst=<stream of 90505 bytes>, lastPnt=SRID=4326;POINT(-43.31917190551758 -23.012861251831055), badMetricCounter=0 where movingObjectId=112 was aborted. Call getNextException to see the cause.
       at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2537)
       at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1328)
       at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:351)
       at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2674)
       at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:519)
       at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
       at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:34)
       at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2403)
       ... 24 more