}
public void afterCompletion(final int status)
{
ctx.setTxSynchronized(false);
final SessionSynchronization sync = ctx.getSessionSynchronization();
// The bean might be lost in action if an exception is thrown in afterBegin
if(ctx.getInstance() == null)
return;
pushEnc();
try
{
// TODO: use interceptors to setup a context
SessionInvocationContext invocation = new BaseSessionInvocationContext(null, null, null) {
@Override
public Object proceed() throws Exception
{
if (status == Status.STATUS_COMMITTED)
{
sync.afterCompletion(true);
}
else
{
sync.afterCompletion(false);
}
return null;
}
};
invocation.setEJBContext(ctx.getEJBContext());