com.ibm.j2ca.base
Class WBILocalTransactionWrapper
java.lang.Object
com.ibm.j2ca.base.WBILocalTransactionWrapper
- All Implemented Interfaces:
- javax.resource.spi.LocalTransaction
- public class WBILocalTransactionWrapper
- extends java.lang.Object
- implements javax.resource.spi.LocalTransaction
This utility class assists in automating some of the work involved with supporting
local transactions. As required by the JCA specification, resource adapter implementations
that support local transactions must track the invocation of local transaciton method calls
to both (1) know when to autocommit and when not to and (2) to notify any
ConnectionEventListeners defined for the ManagedConnection instance of when a transaction
is started or completed. This class automates both of these requirements.
When a local transaction is started, this class notifies any ConnectionEventListeners
for a designated WBIManagedConnection instance of the transaction start and also sets a
flag on the WBIManagedConnection (see EnlistedInTransaction property) so the
WBIManagedConnection knows not to autocommit.
When a local transaction is committed or rolled back (in other words, when it's complete),
this class again notifies any ConnectionEventListeners and resets the flag on the
WBIManagedConnection so that the connection knows to start autocommitting any
operations performed from this point forward.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WBILocalTransactionWrapper
public WBILocalTransactionWrapper(javax.resource.spi.LocalTransaction localTxDelegate,
WBIManagedConnection mc)
begin
public void begin()
throws javax.resource.ResourceException
- Specified by:
begin
in interface javax.resource.spi.LocalTransaction
- Throws:
javax.resource.ResourceException
commit
public void commit()
throws javax.resource.ResourceException
- Specified by:
commit
in interface javax.resource.spi.LocalTransaction
- Throws:
javax.resource.ResourceException
rollback
public void rollback()
throws javax.resource.ResourceException
- Specified by:
rollback
in interface javax.resource.spi.LocalTransaction
- Throws:
javax.resource.ResourceException