users@jta-spec.java.net

[jta-spec users] JTA_SPEC-3 "Define timing of delist/end in relation to beforeCompletion" draft

From: Paul Parkinson <paul.parkinson_at_oracle.com>
Date: Mon, 31 Dec 2012 10:29:40 -0500

Hello,

I've just reworded Ian's note/summary for this item a bit. This will be placed at the end of section 3.3.1 Resource Enlistment in the spec as seen below. Please provide feedback as soon as possible if you would...

"A container only needs to call delistResource to explicitly dissociate a resource from a transaction and it is not a mandatory container requirement to do so as a precondition to transaction completion. A transaction manager is, however, required to implicitly insure the association of any associated XAResource is ended, via the appropriate XAResource.end call, immediately prior to completion; that is before prepare (or commit/rollback in the onephase-optimized case)."

Thanks,
Paul


Under 3.3.1 Resource Enlistment
The Transaction.delistResource method is used to disassociate the specified resource from the transaction context in the target object. The application server invokes the delistResource method with the following two parameters:

The XAResource object that represents the resource.

A flag to indicate whether the delistment was due to:

• The transaction being suspended (TMSUSPEND).
• A portion of the work has failed (TMFAIL).
• A normal resource release by the application (TMSUCCESS).

An example of TMFAIL could be the situation where an application receives an exception on its connection operation.

The delist request results in the transaction manager informing the resource manager to end the association of the transaction with the target XAResource. The flag value allows the application server to indicate whether it intends to come back to the same resource. The transaction manager passes the appropriate flag value in its XAResource.end method call to the underlying resource manager.

A container only needs to call delistResource to explicitly dissociate a resource from a transaction and it is not a mandatory container requirement to do so as a precondition to transaction completion. A transaction manager is, however, required to implicitly insure the association of any associated XAResource is ended, via the appropriate XAResource.end call, immediately prior to completion; that is before prepare (or commit/rollback in the onephase-optimized case).