App developers shall be able to register Transaction synchronization callbacks to get informed before and after a transaction is committed or rolled back.
A method beforeCompletion() shall be calles whenever a Transaction will be committed; a method afterCompletion() shall be called when a Transaction was committed or rolled back. A boolean argument shall be given to indicate if it was committed or rolled back.
The callback shall be attached to a Session by extending the Session interface for a addTransactionCallback() method. Maybe it makes sense to also be able to register general callbacks with the SeesionManager. This mechanism works for manual Transaction handling.
To think about: For container managed transactions with a resource adapter it would be necessary to register a Synchronization callback with the AppServer's TransactionManager. (See interface javax.transaction.Synchronization.) Is it possible to support with the above mentioned mechanism, in a manner which is transparent to the application developer?
To do: Integration test
moved to github tracker