3 Replies Latest reply on Oct 5, 2005 10:28 AM by pabry

    Parallell requests fails with message

    pabry

      I have an application that calls a stateless session bean than in turn calls other stateless session beans, which operates on entity beans.

      This works fine when one thread calls the first session bean a number of times in serial, but it fails when I do the call with several threads in parallell.

      What do I have to think about in this scenario? Is it a transaction configuration maybe? Or is it something with the use of the EntityManager?

      The exception I get is the following:

      java.lang.RuntimeException: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=putte/632, BranchQual=, localId=632] status=STATUS_NO_TRANSACTION; - nested throwable: (org.hibernate.cache.CacheException: org.jboss.cache.lock.UpgradeException: acquireWriteLock(): lock upgrade failed for /com/portwise/genua/user/User/com.portwise.genua.user.User#pabry1 (caller=<putte:1144>:547); - nested throwable: (org.jboss.cache.lock.UpgradeException: upgradeLockAttempt(): more than one reader trying to simultaneously upgrade to write lock))
       at org.jboss.aspects.tx.TxPolicy.handleEndTransactionException(TxPolicy.java:185)
       at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:167)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:74)
       at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:181)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:61)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:32)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:239)
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:107)
       at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:69)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:566)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:436)
       at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:239)
       at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:291)
       at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:168)
      Caused by: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=putte/632, BranchQual=, localId=632] status=STATUS_NO_TRANSACTION; - nested throwable: (org.hibernate.cache.CacheException: org.jboss.cache.lock.UpgradeException: acquireWriteLock(): lock upgrade failed for /com/portwise/genua/user/User/com.portwise.genua.user.User#pabry1 (caller=<putte:1144>:547); - nested throwable: (org.jboss.cache.lock.UpgradeException: upgradeLockAttempt(): more than one reader trying to simultaneously upgrade to write lock))
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:354)
       at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:162)
       ... 19 more
      Caused by: org.hibernate.cache.CacheException: org.jboss.cache.lock.UpgradeException: acquireWriteLock(): lock upgrade failed for /com/portwise/genua/user/User/com.portwise.genua.user.User#pabry1 (caller=<putte:1144>:547); - nested throwable: (org.jboss.cache.lock.UpgradeException: upgradeLockAttempt(): more than one reader trying to simultaneously upgrade to write lock)
       at org.hibernate.cache.TreeCache.update(TreeCache.java:66)
       at org.hibernate.cache.TransactionalCache.update(TransactionalCache.java:71)
       at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:143)
       at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
       at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:877)
       at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:185)
       at org.jboss.ejb3.entity.ManagedEntityManagerFactory$SessionSynchronization.beforeCompletion(ManagedEntityManagerFactory.java:89)
       at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1473)
       at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1092)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:306)
       ... 20 more
      Caused by: org.jboss.cache.lock.UpgradeException: acquireWriteLock(): lock upgrade failed for /com/portwise/genua/user/User/com.portwise.genua.user.User#pabry1 (caller=<putte:1144>:547); - nested throwable: (org.jboss.cache.lock.UpgradeException: upgradeLockAttempt(): more than one reader trying to simultaneously upgrade to write lock)
       at org.jboss.cache.lock.IdentityLock.acquireWriteLock(IdentityLock.java:146)
       at org.jboss.cache.Node.acquireWriteLock(Node.java:485)
       at org.jboss.cache.Node.acquire(Node.java:442)
       at org.jboss.cache.interceptors.LockInterceptor.lock(LockInterceptor.java:246)
       at org.jboss.cache.interceptors.LockInterceptor.invoke(LockInterceptor.java:162)
       at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:46)
       at org.jboss.cache.interceptors.UnlockInterceptor.invoke(UnlockInterceptor.java:41)
       at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:46)
       at org.jboss.cache.interceptors.ReplicationInterceptor.invoke(ReplicationInterceptor.java:57)
       at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:3102)
       at org.jboss.cache.TreeCache.put(TreeCache.java:1745)
       at org.hibernate.cache.TreeCache.update(TreeCache.java:63)
       ... 33 more
      Caused by: org.jboss.cache.lock.UpgradeException: upgradeLockAttempt(): more than one reader trying to simultaneously upgrade to write lock
       at org.jboss.cache.lock.ReadWriteLockWithUpgrade.upgradeLockAttempt(ReadWriteLockWithUpgrade.java:101)
       at org.jboss.cache.lock.LockStrategyRepeatableRead.upgradeLockAttempt(LockStrategyRepeatableRead.java:43)
       at org.jboss.cache.lock.IdentityLock.acquireWriteLock(IdentityLock.java:142)
       ... 44 more