@Override public ActionQueue getActionQueue() { return delegate.getActionQueue(); }
session.getActionQueue().registerProcess( new BeforeCallbackCompletionHandler() );
@Override public ActionQueue getActionQueue() { return delegate.getActionQueue(); }
@Override public ActionQueue getActionQueue() { return getSessionImplementor().getActionQueue(); }
private void registerSynchronization(SessionImplementor sessionImplementor, Synchronization synchronization) { //use {Before|After}TransactionCompletionProcess instead of registerSynchronization because it does not //swallow transactions. /* * HSEARCH-540: the pre process must be both a BeforeTransactionCompletionProcess and a TX Synchronization. * * In a resource-local tx env, the beforeCommit phase is called after the flush, and prepares work queue. * Also, any exceptions that occur during that are propagated (if a Synchronization was used, the exceptions * would be eaten). * * In a JTA env, the before transaction completion is called before the flush, so not all changes are yet * written. However, Synchronization-s do propagate exceptions, so they can be safely used. */ final ActionQueue actionQueue = sessionImplementor.getActionQueue(); SynchronizationAdapter adapter = new SynchronizationAdapter( synchronization ); boolean isLocal = isLocalTransaction( sessionImplementor ); if ( isLocal ) { //if local tx never use Synchronization actionQueue.registerProcess( (BeforeTransactionCompletionProcess) adapter ); } else { //TODO could we remove the action queue registration in this case? actionQueue.registerProcess( (BeforeTransactionCompletionProcess) adapter ); sessionImplementor.accessTransaction().registerSynchronization( adapter ); } //executed in all environments actionQueue.registerProcess( (AfterTransactionCompletionProcess) adapter ); }