Product SiteDocumentation Site

2.8. Transaction synchronization

Transaction synchronization allows the application server to be notified before and after the transaction completes. For each transaction started, the application server may optionally register a Synchronization call-back object to be invoked by the transaction manager, which will be one of the following:
beforeCompletion
Called before the start of the two-phase transaction complete process. This call is executed in the same transaction context of the caller who initiates the TransactionManager.commit or the call is executed with no transaction context if Transaction.commit is used.
afterCompletion
Called after the transaction completes. The status of the transaction is supplied in the parameter. This method is executed without a transaction context.