9 Replies Latest reply on Jul 11, 2007 12:59 PM by Manik Surtani

    Exception occured during transaction commit - JBoss tree Cac

    Shesathiri Govindan Newbie

      Hi,
      Anyone faced this problem, please help me out. I am using Treecache and transaction is controled by Weblogic container through stateless bean.
      I pass the value in config file for transaction as
      com.csfb.opera.processLauncher.cache.TransactionManagerLookupImpl

      and my class has implementaion to get Transaction Manager like below

      public TransactionManager getTransactionManager() throws Exception {
      Context ic = new InitialContext();
      TransactionManager tm = (TransactionManager) ic.lookup("weblogic.transaction.TransactionManager");
      return tm;
      }

      It dose everything very well but during commit I get following Exception.

      I used Sleepycat org.jboss.cache.loader.bdbje.BdbjeCacheLoader as cacheloader and JBossCache1.4.1.SP3.

      at weblogic.transaction.internal.TransactionImpl.setRollbackOnly(TransactionImpl.java:504)
      at org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler.beforeCompletion(TxInterceptor.java:1154)
      at org.jboss.cache.interceptors.OrderedSynchronizationHandler.beforeCompletion(OrderedSynchronizationHandler.java:75)
      at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1010)
      at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:115)
      at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1216)
      at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1990)
      at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:275)
      at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:246)
      at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:299)
      at weblogic.ejb20.internal.StatelessEJBObject.postInvoke(StatelessEJBObject.java:140)
      at com.csfb.opera.processLauncher.ejb.processLauncherSession_gxma9q_EOImpl.startByRegion(processLauncherSession_gxma9q_EOImpl.java:1863)
      at com.csfb.opera.processLauncher.ejb.processLauncherSession_gxma9q_EOImpl_WLSkel.invoke(Unknown Source)
      at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
      at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
      at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
      at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
      at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
      at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
      at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

        • 1. Re: Exception occured during transaction commit - JBoss tree
          Elias Ross Master

          What's the exception being thrown (seems missing).

          • 2. Re: Exception occured during transaction commit - JBoss tree
            Shesathiri Govindan Newbie

            Exception is AppSetRollbackOnlyException and stack trace

            <Jul 10, 2007 2:43:46 PM EDT> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB com.csfb.opera.processLauncher.ejb.ProcessLauncherSessionBean.startByRegion(java.lang.String)],Xid=BEA1-00026F62329F67EE5CC1(28697514),Status=Rolled back. [Reason=weblogic.transaction.internal.AppSetRollbackOnlyException],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=891,seconds left=57,XAServerResourceInfo[OperaDBConnections]=(ServerResourceInfo[OperaDBConnections]=(state=rolledback,assigned=admin),xar=OperaDBConnections,re-Registered = false),XAServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(state=rolledback,assigned=admin),xar=weblogic.jdbc.wrapper.JTSXAResourceImpl@75cb7f,re-Registered = false),XAServerResourceInfo[JMS_processLauncher.jmsStore]=(ServerResourceInfo[JMS_processLauncher.jmsStore]=(state=rolledback,assigned=admin),xar=JMS_processLauncher.jmsStore,re-Registered = false),SCInfo[mydomain+admin]=(state=rolledback),properties=({weblogic.transaction.name=[EJB com.csfb.opera.processLauncher.ejb.ProcessLauncherSessionBean.startByRegion(java.lang.String)], weblogic.jdbc=t3://localhost:7001}),local properties=({}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=admin+127.0.0.1:7001+mydomain+t3+, XAResources={},NonXAResources={})],CoordinatorURL=admin+127.0.0.1:7001+mydomain+t3+): weblogic.transaction.internal.AppSetRollbackOnlyException
            at weblogic.transaction.internal.TransactionImpl.setRollbackOnly(TransactionImpl.java:504)
            at org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler.beforeCompletion(TxInterceptor.java:1154)
            at org.jboss.cache.interceptors.OrderedSynchronizationHandler.beforeCompletion(OrderedSynchronizationHandler.java:75)
            at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1010)
            at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:115)
            at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1216)
            at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1990)
            at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:275)
            at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:246)
            at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:299)
            at weblogic.ejb20.internal.StatelessEJBObject.postInvoke(StatelessEJBObject.java:140)
            at com.csfb.opera.processLauncher.ejb.processLauncherSession_gxma9q_EOImpl.startByRegion(processLauncherSession_gxma9q_EOImpl.java:1863)
            at com.csfb.opera.processLauncher.ejb.processLauncherSession_gxma9q_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
            at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
            at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
            at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
            --------------- nested within: ------------------
            weblogic.transaction.RollbackException: Unknown reason - with nested exception:
            [weblogic.transaction.internal.AppSetRollbackOnlyException]
            at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1683)
            at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:325)
            at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:246)
            at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:299)
            at weblogic.ejb20.internal.StatelessEJBObject.postInvoke(StatelessEJBObject.java:140)
            at com.csfb.opera.processLauncher.ejb.processLauncherSession_gxma9q_EOImpl.startByRegion(processLauncherSession_gxma9q_EOImpl.java:1863)
            at com.csfb.opera.processLauncher.ejb.processLauncherSession_gxma9q_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
            at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
            at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
            at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
            .>

            • 3. Re: Exception occured during transaction commit - JBoss tree
              Manik Surtani Master

              Basically an exception is caught when attempting to prepare the transaction, and before I can log the exception WL's TM throws an exception first since I call setRollbackOnly() on the transaction before I throw the exception.

              What seems to happen though is calling setRollbackOnly() generates it's own exception.

              What version of WL are you using?

              • 4. Re: Exception occured during transaction commit - JBoss tree
                Shesathiri Govindan Newbie

                I am using WebLogic 8.1 sp4.
                I was caching lots of object during server startup , right now we are using EHCahche and that takes around 30 min. Using JBoss cache it takes around an hour and throws this exception at TxInterceptor$LocalSynchronizationHandler.beforeCompletion
                Your help is highly appreciated.
                Thanks,
                Sesha

                • 5. Re: Exception occured during transaction commit - JBoss tree
                  Manik Surtani Master

                  Do you have any more logs about the problem? It seems like somewhere down the interceptor chain you hit a problem (possibly a lock acquisition timeout) and this causes your tx to rollback.

                  Now unfortunately WL's TM throws it's own exception when I call setRollbackOnly() so I don't have a chance to log the real exception. (JBCACHE-1130)

                  Once the above JIRA is fixed, I gsuest getting a snapshot of the 1.4.x branch from CVS and trying with that - it will log more info on the underlying exception.

                  Also, how do you have your data organised? Remember that all locking in JBoss Cache happens on the node level. Having a lot of threads reading/writing to the same node can cause concurrency problems and hence timeouts, tx rollbacks, etc.

                  • 6. Re: Exception occured during transaction commit - JBoss tree
                    Shesathiri Govindan Newbie

                    Unfortunately I don't have much log since this a Batch application.
                    The way Data was organized is I have around 32 tables and each has pointed to a node. Possible that lot of read /Writes happening with the same node.

                    • 7. Re: Exception occured during transaction commit - JBoss tree
                      Manik Surtani Master

                      How many rows in each table? I presume this corresponds to a number of key/value pairs in each node?

                      • 8. Re: Exception occured during transaction commit - JBoss tree
                        Shesathiri Govindan Newbie

                        I am not getting the problem if the no of rows in each table is 50 or less.If it crosses the limit I am geeting it out . As per the business need each table might have more than 2500 rows.

                        • 9. Re: Exception occured during transaction commit - JBoss tree
                          Manik Surtani Master

                          Right, you need to redesign the way you store this data in the cache's tree structure.

                          Try something like /Table#1/Row#1 and put row #1's data under that node. Row #2's data in /Table#1/Row#2, etc etc. This will reduce contention a great deal.

                          If you want to take things a step further, you could use structure nodes in between, sich as /Table#1/Rows#1-99/Row#1, /Table#1/Rows#100-199/Row#120, etc etc.