private void afterInvoke(ThreadContext callContext, TransactionPolicy txPolicy, Instance instance) throws OpenEJBException {
try {
unregisterEntityManagers(instance, callContext);
if (instance != null && txPolicy instanceof BeanTransactionPolicy) {
// suspend the currently running transaction if any
SuspendedTransaction suspendedTransaction = null;
try {
BeanTransactionPolicy beanTxEnv = (BeanTransactionPolicy) txPolicy;
suspendedTransaction = beanTxEnv.suspendUserTransaction();
} catch (SystemException e) {
handleSystemException(txPolicy, e, callContext);