Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-881

Transaction is not active in JBOSSTS_4_6_1_GA

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • None
    • 4.6.1
    • JTA
    • None
    • Hide

      Sometimes it can reproduce in following step:
      1、Set up the JBOSS datasource with pool max&min capacity to 1;
      2、Debug mode to step call the SQL statement in SLSB's method(with default transaction attribute);
      3、Kill the session by background database management tool(Oracle DB:sqlplus with command:alter system kill session '

      {sid}

      ,

      {serial#}

      ')
      4、Continue the thread which is paused in 3;
      5、Exception is throwed by method org.jboss.aspects.tx.TxPolicy.endTransaction;
      6、Call the SLSB's method again,the error "Transaction is not active" is reproduce sometimes.

      Show
      Sometimes it can reproduce in following step: 1、Set up the JBOSS datasource with pool max&min capacity to 1; 2、Debug mode to step call the SQL statement in SLSB's method(with default transaction attribute); 3、Kill the session by background database management tool(Oracle DB:sqlplus with command:alter system kill session ' {sid} , {serial#} ') 4、Continue the thread which is paused in 3; 5、Exception is throwed by method org.jboss.aspects.tx.TxPolicy.endTransaction; 6、Call the SLSB's method again,the error "Transaction is not active" is reproduce sometimes.

    Description

      I found the following error log in the server log file when my application work not properly.
      ===============================================================================================================
      12:45:00,300 SEVERE [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >)
      12:45:00,302 ERROR [OrganizationBean] Get user menu error:userId=sales_huangchi;permissionUrl=sales
      javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
      at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
      at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
      at com.tcl.drp.ejb.right.FunctionPermissionBean.getPermissionMenuLevelItemById(FunctionPermissionBean.java:201)
      at sun.reflect.GeneratedMethodAccessor956.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
      at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
      at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
      at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
      at sun.reflect.GeneratedMethodAccessor282.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
      at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_2094028558.invoke(InvocationContextInterceptor_z_fillMethod_2094028558.java)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
      at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_2094028558.invoke(InvocationContextInterceptor_z_setup_2094028558.java)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:194)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:421)
      at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
      at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:524)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)
      Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
      at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
      at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
      at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
      at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573)
      at org.hibernate.loader.Loader.doQuery(Loader.java:696)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
      at org.hibernate.loader.Loader.doList(Loader.java:2228)
      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
      at org.hibernate.loader.Loader.list(Loader.java:2120)
      at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
      at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1722)
      at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
      at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
      at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
      ... 56 more
      Caused by: org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
      at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:46)
      at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
      ... 69 more
      Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >
      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:370)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
      ... 71 more
      ==============================================================================================================================

      I am sure that the application code "com.tcl.drp.ejb.right.FunctionPermissionBean.getPermissionMenuLevelItemById" which lead to interact with Oracle Database response time is very short.
      And I am sure that the application code "com.tcl.drp.ejb.right.FunctionPermissionBean.getPermissionMenuLevelItemById" is direct called by client code which is not associated with transaction(that is the transaction is managed(begin/commit/rollback) by the EJB Container).
      I found something intresting is the the EJB's call is in the CallerTx:
      ===================================================================================
      ......
      at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:194)
      ......
      ===================================================================================
      In other word is that the EJB Container found a transaction is associated with current thread!

      I search the key:"a030353:da53:4e5ebfb4:116904" in the server log file,some relate exception is found with that transaction(a030353:da53:4e5ebfb4:116904):
      ====================================================================================
      11:54:54,929 WARN [TxConnectionManager] Connection error occured: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@e786a41[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@91dfb7a handles=0 lastUse=1314849250816 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@27884b14 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@64f92252 xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@387d8d3 txSync=null]
      java.sql.SQLException: Io Exception:Broken pipe (errno:32)
      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
      at oracle.jdbc.driver.OracleConnection.rollback(OracleConnection.java:1380)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnection.rollback(LocalManagedConnection.java:97)
      at org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource.rollback(TxConnectionManager.java:1105)
      at com.arjuna.ats.internal.jta.resources.arjunacore.XAOnePhaseResource.rollback(XAOnePhaseResource.java:138)
      at com.arjuna.ats.arjuna.LastResourceRecord.topLevelAbort(LastResourceRecord.java:143)
      at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:3270)
      at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:3248)
      at com.arjuna.ats.arjuna.coordinator.BasicAction.Abort(BasicAction.java:1933)
      at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:114)
      at com.arjuna.ats.arjuna.AtomicAction.abort(AtomicAction.java:201)
      at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1497)
      at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:165)
      at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:114)
      at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:162)
      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:421)
      at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
      at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:551)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)
      11:54:55,654 SEVERE [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >)
      11:54:55,668 ERROR [TxPolicy] javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection
      11:54:55,878 SEVERE [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >)
      ====================================================================================

      My question is :Is that a bug of JBOSS JTS_4_6_1?

      Attachments

        Activity

          People

            thjenkin@redhat.com Tom Jenkinson
            error_t_jira e t (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: