[jboss-dev-forums] [JBoss Transactions Development] - EJB3.0 transaction not active Realy strange!!!

dimitar dimitar do-not-reply at jboss.com
Tue Apr 6 09:19:19 EDT 2010


dimitar dimitar [http://community.jboss.org/people/dimitarn] created the discussion

"EJB3.0 transaction not active Realy strange!!!"

To view the discussion, visit: http://community.jboss.org/message/535788#535788

--------------------------------------------------------------
 http://community.jboss.org/message/535788#535788/JDBCExceptionReporter http://community.jboss.org/message/535788#535788/JDBCExceptionReporter SQL Error: 0, SQLState: null15:44:29,962 ERROR  http://community.jboss.org/message/535788#535788/JDBCExceptionReporter http://community.jboss.org/message/535788#535788/JDBCExceptionReporter Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:c779:4bbb2b0e:505b status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:c779:4bbb2b0e:505b status: ActionStatus.ABORT_ONLY >)15:44:29,967 ERROR  http://community.jboss.org/message/535788#535788/TxPolicy http://community.jboss.org/message/535788#535788/TxPolicy javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection15:44:29,970 ERROR  http://community.jboss.org/message/535788#535788/PositionsManagementBean http://community.jboss.org/message/535788#535788/PositionsManagementBean PositionsManagementIntr::onMessage()::The exception type is: javax.ejb.EJBTransactionRolledbackException15:44:29,970 ERROR  http://community.jboss.org/message/535788#535788/PositionsManagementBean http://community.jboss.org/message/535788#535788/PositionsManagementBean PositionsManagementIntr::onMessage()::The exception is:::org.hibernate.exception.GenericJDBCException: Cannot open connection15:44:29,970 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection15:44:29,971 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:115)15:44:29,971 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)15:44:29,971 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:194)15:44:29,971 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)15:44:29,971 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)15:44:29,971 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)15:44:29,971 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)15:44:29,971 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)15:44:29,971 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)15:44:29,971 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)15:44:29,971 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)15:44:29,971 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)15:44:29,972 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)15:44:29,972 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)15:44:29,972 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)15:44:29,972 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)15:44:29,972 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:176)15:44:29,972 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:216)15:44:29,972 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)15:44:29,972 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)15:44:29,972 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at $Proxy731.method5(Unknown Source)
15:44:29,972 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at MyBean.method4(MyBean.java:337)15:44:29,972 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at MyBean.method3(MyBean.java:324)
15:44:29,972 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at MyBean.method2(MyBean.java:132)
15:44:29,972 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...............

at $Proxy851.onMessage(Unknown Source)15:44:29,978 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at ManagementBean.onMessage(PositionsQueueManager.java:59)
15:44:29,978 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.jms.client.container.ClientConsumer.callOnMessage(ClientConsumer.java:229)15:44:29,978 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.jms.client.container.ClientConsumer$ListenerRunner.run(ClientConsumer.java:1043)15:44:29,978 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at org.jboss.messaging.util.OrderedExecutorFactory$ChildExecutor.run(OrderedExecutorFactory.java:120)15:44:29,979 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)15:44:29,979 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)15:44:29,979 ERROR  http://community.jboss.org/message/535788#535788/STDERR http://community.jboss.org/message/535788#535788/STDERR     at java.lang.Thread.run(Thread.java:619)



@Stateful
@CacheConfig(idleTimeoutSeconds = 3600)
public class ManagementBean implements IManagementLocal {
 
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public void onMessage(final javax.jms.Message msg) { 
     method1(msg);
}
 
private void method1(msg) {
     for(...) {
          processBean.method2(...); //statless bean call
 
     }
 
}
 
 
 
}
 
 
 
 
 
 
 
@Statless
 
public class ProcessBean {
 
 
 
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
 
public void method2(...) {
 if(...) {
     method3(..);
} else { 
 try {
 method4(...);
 } catch(Exception e) {
     method3(...); 
     }
}
}
 
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
private void method3(...) {
 
     otherStatlesBean.method5(); //This is with the default trans atributte required
}
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
private void method4(...) {
 
}
 
}
 
 


I cannot understand WHY it is complaining with transaction not active
In method2 if method4 fails(it is executed in new separate tarnsaction) i catch the excepton and call method3 which calls statless bean method and there it complains that the transaction is not active, How can a just created new transaction  in the caller bean be not active???

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/535788#535788]

Start a new discussion in JBoss Transactions Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2041]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20100406/9dc6c024/attachment.html 


More information about the jboss-dev-forums mailing list