Search code examples
javaspringtransactionsejbruntimeexception

Spring transaction called by EJB: REQUIRES_NEW needed for transactional method in Catch, when Try's transactional method has RuntimeException


I'm calling a transaction methodA from non-transaction class try block (which is called by another EJB class), which will throw a RuntimeException

Then in the catch block, transactional methodB will handle the exp.

What's surprising is that I have to annotate methodB with REQUIRES_NEW, otherwise the program will have Transaction is not active exception. (stacktrace similar to this)

Is this because methodA's transaction, which is marked to be rollback for the RuntimeException, is not yet ended in the catch block. Then methodB without REQUIRES_NEW reused the to-be-rollback transaction and landed in the exception?

This runs against my understanding of spring transaction though, as I thought methodA's transaction should end with methodA in the try block. And methodB will create a new transaction since there is no longer any transaction existing.

//non-transactional method
method(){
    ...
    try{
         classA.methodA();
    }catch(RuntimeException ex){
         classB.methodB(ex);
    }
    ...
}

ClassA
    @Transactional
    methodA(){...}

ClassB
    @Transactional
    methodB(){...}


Stack trace:

I'm using jBoss with DB2

handleEsbExceptionalRequirement is methodB

first line is the error thrown by methodA

16:32:35,603 ERROR [au.com.aia.euwb.services.newbusiness.EUWBNewBusinessOrchestrationServiceImpl] (EJB default - 4) URI scheme is not "file"
16:32:35,604 INFO  [au.com.aia.euwb.services.newbusiness.EUWBNewBusinessOrchestrationServiceImpl] (EJB default - 4) NewBusinessOrchestraService WS call to preview SAT letter - ended.
16:32:35,604 INFO  [au.com.aia.euwb.services.life.proposals.requirements.esb.outbound.service.job.EsbOutboundJobServiceImpl] (EJB default - 4) *******esb*******processEsbOutboundCall: Exception caught
16:32:35,605 INFO  [au.com.aia.euwb.services.life.proposals.requirements.EUWBRequirementServiceImpl] (EJB default - 4) *******esb*******handleEsbExceptionalRequirement: started
16:32:35,606 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (EJB default - 4) SQL Error: 0, SQLState: null
16:32:35,606 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (EJB default - 4) javax.resource.ResourceException: IJ000460: Error checking for a transaction
16:32:35,606 ERROR [com.axelerator.platform.foundation.operations.ejb.timers.OperationsEJBTimer] (EJB default - 4) Operations job 'eUWB ESB Outbound Synch Processing' failed; details: org.hibernate.exception.GenericJDBCException: Could not open connection
16:32:35,608 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (EJB default - 4) SQL Error: 0, SQLState: null
16:32:35,608 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (EJB default - 4) javax.resource.ResourceException: IJ000460: Error checking for a transaction
16:32:35,608 INFO  [org.hibernate.event.internal.DefaultLoadEventListener] (EJB default - 4) HHH000327: Error performing load command : org.hibernate.exception.GenericJDBCException: Could not open connection
16:32:35,615 ERROR [org.jboss.as.ejb3] (EJB default - 4) JBAS014122: Error during retrying timeout for timer: [id=9c0f3b7a-6513-488a-a716-cae7664c3e65 timedObjectId=axelerator-project-admin-app-14.3.5-SNAPSHOT.euwb-operations-ejb-14.3.5-SNAPSHOT.ExecuteEUWBESBOutboundSynchBean auto-timer?:false persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@775989be initialExpiration=Fri Apr 03 16:32:32 AEDT 2020 intervalDuration(in milli sec)=0 nextExpiration=null timerState=RETRY_TIMEOUT info=euwb/executeEUWBESBOutboundSynch:MANUAL]: javax.ejb.EJBException: org.hibernate.exception.GenericJDBCException: Could not open connection
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:191) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.as.ejb3.tx.TimerCMTTxInterceptor.handleExceptionInOurTx(TimerCMTTxInterceptor.java:53) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:282) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:367) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:245) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.as.ejb3.timerservice.TimedObjectInvokerImpl.callTimeout(TimedObjectInvokerImpl.java:101) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.as.ejb3.timerservice.TimedObjectInvokerImpl.callTimeout(TimedObjectInvokerImpl.java:111) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.as.ejb3.timerservice.task.TimerTask.callTimeout(TimerTask.java:187) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.as.ejb3.timerservice.task.TimerTask.retryTimeout(TimerTask.java:210) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.as.ejb3.timerservice.task.TimerTask.run(TimerTask.java:167) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_131]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_131]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_131]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_131]
    at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_131]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.2.Final-redhat-1.jar:2.1.2.Final-redhat-1]
Caused by: org.hibernate.exception.GenericJDBCException: Could not open connection
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:221) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:157) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.connection(StatementPreparerImpl.java:56) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:159) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:183) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:157) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1881) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1858) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1838) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.loader.Loader.doQuery(Loader.java:906) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:318) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.loader.Loader.loadEntity(Loader.java:2145) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:82) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:72) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3939) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:462) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:431) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:208) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:264) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1053) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.internal.SessionImpl.access$2000(SessionImpl.java:173) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2449) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.internal.SessionImpl.get(SessionImpl.java:953) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.event.internal.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:300) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:180) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:86) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:833) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:817) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:821) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at com.axelerator.platform.foundation.operations.services.jobs.OperationsJobServiceImpl.updateOperationsJobCurrentState(OperationsJobServiceImpl.java:129)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_131]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_131]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_131]
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
    at com.sun.proxy.$Proxy871.updateOperationsJobCurrentState(Unknown Source)
    at com.axelerator.platform.foundation.operations.ejb.timers.OperationsEJBTimer.afterJobExecution(OperationsEJBTimer.java:464)
    at com.axelerator.platform.foundation.operations.ejb.timers.OperationsEJBTimer.ejbTimeout(OperationsEJBTimer.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_131]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_131]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_131]
    at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52) [jboss-as-ee-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:61) [jboss-as-ee-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:61) [jboss-as-ee-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:280) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    ... 25 more
Caused by: java.sql.SQLException: javax.resource.ResourceException: IJ000460: Error checking for a transaction
    at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:151)
    at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:141) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:301) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:214) [hibernate-core-4.2.18.Final-redhat-2.jar:4.2.18.Final-redhat-2]
    ... 95 more
Caused by: javax.resource.ResourceException: IJ000460: Error checking for a transaction
    at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:362)
    at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:510)
    at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:143)
    ... 98 more
Caused by: javax.resource.ResourceException: IJ000459: Transaction is not active: tx=TransactionImple < ac, BasicAction: 0:ffffc0a86301:5c0befd5:5e86c9fc:ba status: ActionStatus.ABORT_ONLY >
    at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:352)
    ... 100 more



Solution

  • The only possibility should be that when method() is called by EJB class, there’s already a transaction opened in the EJB class, resulting in the behaviour described.