public Transaction getTransaction() throws SystemException { return transactionManager.getTransaction(); }
/** * provides the current transaction * @return Transaction * @throws SystemException when unable to get the transaction */ public Transaction getTransaction() throws SystemException { return getTransactionManager().getTransaction(); }
public String getTransactionId() { JavaEETransaction tx = null; try { tx = (JavaEETransaction) EjbContainerUtilImpl.getInstance(). getTransactionManager().getTransaction(); } catch (Exception ex) { //TODO: Log exception } return (tx == null) ? null : ""+tx; //TODO tx.getTransactionId(); }
private JavaEETransaction getCurrentTransaction() throws SystemException { JavaEETransactionManager txMgr = ConnectorRuntime.getRuntime().getTransactionManager(); return (JavaEETransaction) txMgr.getTransaction(); }
/** * Called from CMP PersistentManager */ public void preSelect() throws javax.ejb.EJBException { // if the ejbSelect is being invoked with the client's transaction, // call ejbStore on all dirty bean instances associated with that // transaction. This ensures that the select results will include // all updates done previously in the client's tx. _logger.fine(" inside preSelect..."); Transaction tx = null; try { _logger.fine("PRESELECT : getting transaction..."); tx = transactionManager.getTransaction(); } catch ( SystemException ex ) { throw new EJBException(ex); } _logger.fine("PRESELECT : calling storeAllBeansInTx()..."); storeAllBeansInTx( tx ); }
public String getTransactionId() { JavaEETransaction tx = null; try { tx = (JavaEETransaction) EjbContainerUtilImpl.getInstance(). getTransactionManager().getTransaction(); } catch (Exception ex) { //TODO: Log exception } return (tx == null) ? null : ""+tx; //TODO tx.getTransactionId(); }
public void rollBackTransaction() { try { JavaEETransactionManager tm = ConnectorRuntime.getRuntime().getTransactionManager(); Transaction tran = tm.getTransaction(); if ( tran != null ) { tran.setRollbackOnly(); } } catch (SystemException ex) { _logger.log(Level.WARNING,"poolmgr.system_exception",ex); } catch (IllegalStateException ex) { // ignore } }
/** * Called from getContext before the ejb.ejbFind* is called */ protected void preFind(EjbInvocation inv, EntityContextImpl context) { // if the finder is being invoked with the client's transaction, // call ejbStore on all dirty bean instances associated with that // transaction. This ensures that the finder results will include // all updates done previously in the client's tx. if ( willInvokeWithClientTx(inv) && !inv.method.getName().equals("findByPrimaryKey") ) { Transaction tx = null; try { tx = transactionManager.getTransaction(); } catch ( SystemException ex ) { throw new EJBException(ex); } storeAllBeansInTx( tx ); } }
/** * delist the <code>ResourceHandle</code> from the transaction * * @param h <code>ResourceHandle</code> object * @param xaresFlag flag indicating transaction success. This can * be XAResource.TMSUCCESS or XAResource.TMFAIL * @exception <code>PoolingException</code> */ public void delistResource(ResourceHandle h, int xaresFlag) { try { JavaEETransactionManager tm = ConnectorRuntime.getRuntime().getTransactionManager(); Transaction tran = tm.getTransaction(); if (tran != null) { tm.delistResource(tran, h, xaresFlag); } } catch (SystemException ex) { _logger.log(Level.WARNING,"poolmgr.system_exception",ex); } catch (IllegalStateException ex) { // ignore } }
/** * Register the <code>ResourceHandle</code> in the transaction * * @param handle <code>ResourceHandle</code> object * @exception <code>PoolingException</code> If there is any error while * enlisting. */ public void enlistResource(ResourceHandle handle) throws PoolingException{ try { JavaEETransactionManager tm = ConnectorRuntime.getRuntime().getTransactionManager(); Transaction tran = tm.getTransaction(); if (tran != null) { tm.enlistResource(tran, handle); } } catch (Exception ex) { _logger.log(Level.SEVERE,"poolmgr.unexpected_exception",ex); throw new PoolingException(ex.toString(), ex); } }
if (i == null) { transaction = ejbContainerUtil.getTransactionManager().getTransaction(); } else { transaction = (Transaction) i.getTransaction();
if (i == null) { transaction = ejbContainerUtil.getTransactionManager().getTransaction(); } else { transaction = (Transaction) i.getTransaction();
@Override protected void afterExecute(Runnable r, Throwable t) { super.afterExecute(r, t); try { JavaEETransactionManager tm = EjbContainerUtilImpl.getInstance().getTransactionManager(); if (tm.getTransaction() != null) { int st = tm.getStatus(); Logger logger = EjbContainerUtilImpl.getLogger(); logger.warning("NON-NULL TX IN AFTER_EXECUTE. TX STATUS: " + st); if (st == Status.STATUS_ROLLEDBACK || st == Status.STATUS_COMMITTED || st == Status.STATUS_UNKNOWN) { tm.clearThreadTx(); } else { tm.rollback(); } } } catch (Exception e) { e.printStackTrace(); } }
current = (JavaEETransaction) transactionManager.getTransaction(); } catch ( SystemException ex ) { throw new EJBException(ex);
tran = tm.getTransaction(); } catch( Exception e ) { tran = null;
public final void doAfterBegin(ComponentInvocation ci) { EjbInvocation inv = (EjbInvocation)ci; try { // Associate the context with tx so that on subsequent // invocations with the same tx, we can do the appropriate // tx.resume etc. EJBContextImpl sc = (EJBContextImpl)inv.context; Transaction tx = transactionManager.getTransaction(); if (! isSingleton) { sc.setTransaction(tx); } // Register Synchronization with TM so that we can // dissociate the context from tx in afterCompletion ejbContainerUtilImpl.getContainerSync(tx).addBean(sc); enlistExtendedEntityManagers(sc); // Dont call container.afterBegin() because // TX_BEAN_MANAGED EntityBeans are not allowed, // and SessionSync calls on TX_BEAN_MANAGED SessionBeans // are not allowed. } catch (SystemException ex) { throw new EJBException(ex); } catch (RollbackException ex) { throw new EJBException(ex); } catch (IllegalStateException ex) { throw new EJBException(ex); } }
public final void doAfterBegin(ComponentInvocation ci) { EjbInvocation inv = (EjbInvocation)ci; try { // Associate the context with tx so that on subsequent // invocations with the same tx, we can do the appropriate // tx.resume etc. EJBContextImpl sc = (EJBContextImpl)inv.context; Transaction tx = transactionManager.getTransaction(); if (! isSingleton) { sc.setTransaction(tx); } // Register Synchronization with TM so that we can // dissociate the context from tx in afterCompletion ejbContainerUtilImpl.getContainerSync(tx).addBean(sc); enlistExtendedEntityManagers(sc); // Dont call container.afterBegin() because // TX_BEAN_MANAGED EntityBeans are not allowed, // and SessionSync calls on TX_BEAN_MANAGED SessionBeans // are not allowed. } catch (SystemException ex) { throw new EJBException(ex); } catch (RollbackException ex) { throw new EJBException(ex); } catch (IllegalStateException ex) { throw new EJBException(ex); } }
Transaction tx = transactionManager.getTransaction(); if (! container.isSingleton) { context.setTransaction(tx);
Transaction tx = transactionManager.getTransaction(); if (! isSingleton) { context.setTransaction(tx);
toMgr.doAfterUtxBegin(); inv.setTransaction(transactionManager.getTransaction()); transactionManager.enlistComponentResources();