Package com.ibm.websphere.jtaextensions
Interface SynchronizationCallback
public interface SynchronizationCallback
An object implementing this interface is enlisted once through the
ExtendedJTATransaction
interface and receives notification of the
completion of each subsequent transaction mediated by the transaction
manager in the local JVM.
While this object may execute in a J2EE server, there is no specific J2EE
component active when this object is called and so it has limited direct
access to any J2EE resources. Specifically, it has no access to the java:
namespace or to any container-mediated resource. It may cache a reference
to J2EE component, for example a stateless SessionBean, that it delegates
to. Such an EJB would then have all the normal access to J2EE
resources and could be used, for example, to acquire a JDBC connection and
flush updates to a database during beforeCompletion
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterCompletion
(int localId, byte[] globalId, boolean committed) Called after each transaction is completed.void
beforeCompletion
(int localId, byte[] globalId) Called before each transaction begins commit processing.
-
Method Details
-
beforeCompletion
void beforeCompletion(int localId, byte[] globalId) Called before each transaction begins commit processing. Provides an opportunity, for example, to flush data to a persistent store prior to the start of two-phase commit. This method is not called prior to a request to rollback or if the transaction has been marked rollbackOnly. The identity of the transaction about to complete is indicated through both thegloballId
andlocalId
(either of which can be used by the callback).- Parameters:
localId
- the process-unique id of the transaction about to complete.globalId
- the global transaction identifier, derived from thePropagationContext
of the global transaction of the transaction about to complete.
-
afterCompletion
void afterCompletion(int localId, byte[] globalId, boolean committed) Called after each transaction is completed. The transaction is not active on the thread at this point. The identity of the transaction just completed is indicated through both thegloballId
andlocalId
(either of which can be used by an callback).- Parameters:
localId
- the process-unique id of the transaction just completed.globalId
- the global transaction identifier, derived from thePropagationContext
of the global transaction of the transaction just completed.committed
- boolean that is true if the transaction outcome was committed or false otherwise.
-