users@glassfish.java.net

Re: JCA - cleanup call for ManagedConnection too early?

From: <glassfish_at_javadesktop.org>
Date: Wed, 12 Sep 2007 11:32:01 PDT

http://java.sun.com/j2se/1.4.2/docs/api/javax/transaction/xa/XAResource.html#end(javax.transaction.xa.Xid,%20int)

You can see that XAResource.end marks the end of the transaction. So, if the XAResource.end is called, then really it should be possible to reuse the connection. In that sense, doing mc.cleanup after the end() seems fine.

However, it does turn a double edged sword that all the resource adapters are not clean enough to
reuse the physical connection right after the end() call.

That is basically the cause for the confusion.

I agree that safest approach might be to do the cleanup() after the commit/rollback.
[Message sent by forum member 'binod' (binod)]

http://forums.java.net/jive/thread.jspa?messageID=235099