<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    EJB3.0 transaction not active Realy strange!!!
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/dimitarn">dimitar dimitar</a> in <i>JBoss Transactions Development</i> - <a href="http://community.jboss.org/message/535788#535788">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p><a class="" href="http://community.jboss.org/message/535788#535788/JDBCExceptionReporter">http://community.jboss.org/message/535788#535788/JDBCExceptionReporter</a> SQL Error: 0, SQLState: null15:44:29,962 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/JDBCExceptionReporter">http://community.jboss.org/message/535788#535788/JDBCExceptionReporter</a> Transaction is not active: tx=TransactionImple &amp;lt; ac, BasicAction: 7f000001:c779:4bbb2b0e:505b status: ActionStatus.ABORT_ONLY &amp;gt;; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple &amp;lt; ac, BasicAction: 7f000001:c779:4bbb2b0e:505b status: ActionStatus.ABORT_ONLY &amp;gt;)15:44:29,967 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/TxPolicy">http://community.jboss.org/message/535788#535788/TxPolicy</a> javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection15:44:29,970 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/PositionsManagementBean">http://community.jboss.org/message/535788#535788/PositionsManagementBean</a> PositionsManagementIntr::onMessage()::The exception type is: javax.ejb.EJBTransactionRolledbackException15:44:29,970 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/PositionsManagementBean">http://community.jboss.org/message/535788#535788/PositionsManagementBean</a> PositionsManagementIntr::onMessage()::The exception is:::org.hibernate.exception.GenericJDBCException: Cannot open connection15:44:29,970 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a> javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection15:44:29,971 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:115)15:44:29,971 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)15:44:29,971 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:194)15:44:29,971 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)15:44:29,971 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)15:44:29,971 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)15:44:29,971 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)15:44:29,971 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)15:44:29,971 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)15:44:29,971 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)15:44:29,971 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)15:44:29,971 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)15:44:29,972 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)15:44:29,972 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)15:44:29,972 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)15:44:29,972 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)15:44:29,972 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:176)15:44:29,972 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:216)15:44:29,972 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)15:44:29,972 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)15:44:29,972 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at $Proxy731.method5(Unknown Source)</p><p>15:44:29,972 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at MyBean.method4(MyBean.java:337)15:44:29,972 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at MyBean.method3(MyBean.java:324)</p><p>15:44:29,972 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at MyBean.method2(MyBean.java:132)</p><p>15:44:29,972 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p>...............</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>at $Proxy851.onMessage(Unknown Source)15:44:29,978 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at ManagementBean.onMessage(PositionsQueueManager.java:59)</p><p>15:44:29,978 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.jms.client.container.ClientConsumer.callOnMessage(ClientConsumer.java:229)15:44:29,978 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.jms.client.container.ClientConsumer$ListenerRunner.run(ClientConsumer.java:1043)15:44:29,978 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at org.jboss.messaging.util.OrderedExecutorFactory$ChildExecutor.run(OrderedExecutorFactory.java:120)15:44:29,979 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)15:44:29,979 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)15:44:29,979 ERROR <a class="" href="http://community.jboss.org/message/535788#535788/STDERR">http://community.jboss.org/message/535788#535788/STDERR</a>&#160;&#160;&#160;&#160; at java.lang.Thread.run(Thread.java:619)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">@Stateful
@CacheConfig(idleTimeoutSeconds = 3600)
<font color="navy"><b>public</b></font> <font color="navy"><b>class</b></font> ManagementBean <font color="navy"><b>implements</b></font> IManagementLocal <font color="navy">{</font>
&#160;
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
&#160;&#160;&#160; <font color="navy"><b>public</b></font> <font color="navy"><b>void</b></font> onMessage(<font color="navy"><b>final</b></font> javax.jms.Message msg) <font color="navy">{</font> 
&#160;&#160;&#160;&#160; method1(msg);
<font color="navy">}</font>
&#160;
<font color="navy"><b>private</b></font> <font color="navy"><b>void</b></font> method1(msg) <font color="navy">{</font>
&#160;&#160;&#160;&#160; <font color="navy"><b>for</b></font>(...) <font color="navy">{</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; processBean.method2(...); <font color="darkgreen">//statless bean call</font>
&#160;
&#160;&#160;&#160;&#160; <font color="navy">}</font>
&#160;
<font color="navy">}</font>
&#160;
&#160;
&#160;
<font color="navy">}</font>
&#160;
&#160;
&#160;
&#160;
&#160;
&#160;
&#160;
@Statless
&#160;
<font color="navy"><b>public</b></font> <font color="navy"><b>class</b></font> ProcessBean <font color="navy">{</font>
&#160;
&#160;
&#160;
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
&#160;
<font color="navy"><b>public</b></font> <font color="navy"><b>void</b></font> method2(...) <font color="navy">{</font>
 <font color="navy"><b>if</b></font>(...) <font color="navy">{</font>
&#160;&#160;&#160;&#160; method3(..);
<font color="navy">}</font> <font color="navy"><b>else</b></font> <font color="navy">{</font> 
 <font color="navy"><b>try</b></font> <font color="navy">{</font>
 method4(...);
 <font color="navy">}</font> <font color="navy"><b>catch</b></font>(Exception e) <font color="navy">{</font>
&#160;&#160;&#160;&#160; method3(...); 
&#160;&#160;&#160;&#160; <font color="navy">}</font>
<font color="navy">}</font>
<font color="navy">}</font>
&#160;
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
<font color="navy"><b>private</b></font> <font color="navy"><b>void</b></font> method3(...) <font color="navy">{</font>
&#160;
&#160;&#160;&#160;&#160; otherStatlesBean.method5(); <font color="darkgreen">//This is with the default trans atributte required</font>
<font color="navy">}</font>
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
<font color="navy"><b>private</b></font> <font color="navy"><b>void</b></font> method4(...) <font color="navy">{</font>
&#160;
<font color="navy">}</font>
&#160;
<font color="navy">}</font>
&#160;
&#160;
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I cannot understand WHY it is complaining with transaction not active</p><p>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&#160; in the caller bean be not active???</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/535788#535788">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Transactions Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2041">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>