public interface SynchronizationCallback
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
.Modifier and Type | Method and Description |
---|---|
void |
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.
|
void beforeCompletion(int localId, byte[] globalId)
globallId
and localId
(either of which can be used by the callback).localId
- the process-unique id of the transaction about to complete.globalId
- the global transaction identifier, derived from the
PropagationContext
of the global transaction
of the transaction about to complete.void afterCompletion(int localId, byte[] globalId, boolean committed)
globallId
and localId
(either of which can be used by an callback).localId
- the process-unique id of the transaction just completed.globalId
- the global transaction identifier, derived from the
PropagationContext
of the global transaction
of the transaction just completed.committed
- boolean that is true if the transaction outcome was
committed or false otherwise.