public void enlistComponentResources() throws RemoteException { if (_logger.isLoggable(Level.FINE)) _logger.log(Level.FINE, "TM: enlistComponentResources"); ComponentInvocation inv = invMgr.getCurrentInvocation(); if (inv == null) return; try { Transaction tran = getTransaction(); inv.setTransaction((JavaEETransaction)tran); enlistComponentResources(inv); } catch (InvocationException ex) { _logger.log(Level.SEVERE, "enterprise_distributedtx.excep_in_enlist" ,ex); throw new RemoteException(ex.getMessage(), ex.getNestedException()); } catch (Exception ex) { _logger.log(Level.SEVERE, "enterprise_distributedtx.excep_in_enlist" ,ex); throw new RemoteException(ex.getMessage(), ex); } }
/** * PostInvoke Transaction configuration for Servlet Container. * BaseContainer.preInvokeTx() handles all this for CMT EJB. * * Precondition: assumed called prior to current transcation being * suspended or released. * * @param suspend indicate whether the delisting is due to suspension or * transaction completion(commmit/rollback) */ public void postInvokeTx(boolean suspend, boolean checkServletInvocation) { final ComponentInvocation inv = invocationManager.getCurrentInvocation(); if (inv != null && (!checkServletInvocation || inv.getInvocationType() == ComponentInvocation.ComponentInvocationType.SERVLET_INVOCATION)) { try { transactionManager.delistComponentResources(suspend); } catch (java.rmi.RemoteException re) { throw new IllegalStateException(re); } finally { inv.setTransaction(null); } } }
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException { if (!initialized) init(); if (userTx != null) { userTx.commit(); return; } ComponentInvocation inv = invocationManager.getCurrentInvocation(); if (inv != null) { checkUserTransactionMethodAccess(inv); } try { transactionManager.delistComponentResources(false); // TMSUCCESS transactionManager.commit(); } catch ( RemoteException ex ) { _logger.log(Level.SEVERE,"enterprise_distributedtx.excep_in_utx_commit", ex); throw new SystemException(); } finally { if (inv != null) inv.setTransaction(null); } }
public void rollback() throws IllegalStateException, SecurityException, SystemException { if (!initialized) init(); if (userTx != null) { userTx.rollback(); return; } ComponentInvocation inv = invocationManager.getCurrentInvocation(); if (inv != null) { checkUserTransactionMethodAccess(inv); } try { transactionManager.delistComponentResources(false); // TMSUCCESS transactionManager.rollback(); } catch ( RemoteException ex ) { _logger.log(Level.SEVERE,"enterprise_distributedtx.excep_in_utx_rollback", ex); throw new SystemException(); } finally { if (inv != null) inv.setTransaction(null); } }
toMgr.doAfterUtxBegin(); inv.setTransaction(transactionManager.getTransaction()); transactionManager.enlistComponentResources();