public void beforeCompletion() { if( log.isTraceEnabled() ) log.trace("beforeCompletion called"); // lock the context the transaction is being commited (no need for sync) ctx.lock(); beforeCompletionInvoked = true; if (notifySession) { try { AllowedOperationsAssociation.pushInMethodFlag(IN_BEFORE_COMPLETION); container.pushENC(); beforeCompletion.invoke(ctx.getInstance(), new Object[0]); } catch (Exception e) { log.error("failed to invoke beforeCompletion", e); } finally { container.popENC(); AllowedOperationsAssociation.popInMethodFlag(); } } }