public void commit() throws HeuristicMixedException, HeuristicRollbackException, IllegalStateException, RollbackException, SecurityException, SystemException {
TransactionContext ctx = TransactionContext.getContext();
if (ctx instanceof BeanTransactionContext == false) {
throw new IllegalStateException("Transaction has not been started");
}
BeanTransactionContext beanContext = (BeanTransactionContext) ctx;
try {
beanContext.commit();
} finally {
UnspecifiedTransactionContext oldContext = beanContext.getOldContext();
TransactionContext.setContext(oldContext);
oldContext.resume();
}
}