<!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="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss 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;">
    Re: JCA Spec violation using resource-adapter in JBoss 7?
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/jsteidl">Jeff Steidl</a> in <i>IronJacamar</i> - <a href="https://community.jboss.org/message/800173#800173">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>To quickly see the problem, search the log summary jleinawe provided (tempm.txt) for "xaResourceWrapper2".&#160; The first three instances are:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>in:managedConnectionImpl0.getXAResource() -&gt; xaResourceWrapper2 #1 @1362075193107..1362075193110</p><p>[...]</p><p>in:xaResourceWrapper2.start(xid3,2097152) #6 @1362075193148..1362075193161</p><p>[...]</p><p>in:xaResourceWrapper2.start(xid5,2097152) threw #8 @1362075193570..1362075193577</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>As you can see, the app-server gets this XAResource from the RA, then calls XAResource.start on it multiple times in a row without calling XAResource.end in between (which is why the RA throws an exception the second time xaResourceWrapper2.start is called).&#160; If you keep searching for "xaResourceWrapper2", you'll see several more calls to XAResource.start, but no calls to XAResource.end.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>If you then search from the top of the log summary for "xid3", you'll find the following calls made to the RA ("in:" calls):</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>in:xaResourceWrapper0.start(xid3,0) #4 @1362075179562..1362075179570</p><p>[...]</p><p>in:xaResourceWrapper2.start(xid3,2097152) #6 @1362075193148..1362075193161</p><p>[...]</p><p>in:xaResourceWrapper0.end(xid3,67108864) #4 @1362075193388..1362075193396</p><p>[...]</p><p>in:xaResourceWrapper0.commit(xid3,true) #4 @1362075193397..1362075193438</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>You can see that while the app-server is ending the association for xaResourceWrapper0 before committing the transaction, it is failing to do so for xaResourceWrapper2.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This line shows that wlConnection0 is the connection handle being used for managedConnectionImpl0:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160; in:managedConnectionImpl0.getConnection(null,connectionRequestInfoImpl0) -&gt; wlConnection0 #1 @1362075193164..1362075193199</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>And if you look at wlConnection0 being closed:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160; in:wlConnection0.close() #1 @1362075193351..1362075193382</p><p>&#160;&#160;&#160;&#160;&#160; out:Connection.stop() #1 @1362075193356..1362075193361</p><p>&#160;&#160;&#160;&#160;&#160; out:XAResource.end(xid3,67108864) #4 @1362075193364..1362075193368</p><p>&#160;&#160;&#160;&#160;&#160; out:ConnectionEventListener.connectionClosed(javax.resource.spi.ConnectionEvent[source=OracleJMSConnector.ManagedConnectionImpl.adc2100774.us.oracle.com.-2ebdb17:13d22011ace:-7ffb.20]) #1 @1362075193372..1362075193379</p><p>out:MessageEndpoint.afterDelivery() #4 @1362075193386..1362075193444</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>you'll see that the RA is calling ConnectionEventListener.connectionClosed, but the app-server is failing to delist xaResourceWrapper2 in response (as the JCA spec requires).&#160; [Note that the "out:XAResource.end" call above is for a secondary JMS provider XAResource used internally by the RA, and is not the same as xaResourceWrapper2.]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Since the above lines are grabbed as-is (except for indent) from tempm.txt, you can see those calls in context by searching for them in that file.</p></div>

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


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

</div>

</body>
</html>