Javadoc
This will get called by the EJB integration code
Since registration of the event can blow up if the tx is not active we have a matrix of assumed behaviour
There are 3 different error cases when registering a TX Synchronization:
RollbackException - Thrown to indicate that the transaction has been marked for rollback only.
IllegalStateException - Thrown if the transaction in the target object is in the prepared state or the transaction is inactive.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.
In case of the SystemException we simply let it blow up. This is usually the case if there
is some setup problem.
In case of a RollbackException or IllegalStateException we will perform different actions based on the
desired TransactionPhase:
For AFTER_COMPLETION, BEFORE_COMPLETION and AFTER_FAILURE we will deliver the event immediately.
For AFTER_SUCCESS we copmletely skip the event. It will not get invoked at all because the transaction
will not succeed.