public Transaction suspend(JavaEETransaction tx) throws SystemException { if ( tx != null ) { tm.setCurrentTransaction(null); } return tx; }
public Transaction getTransaction() throws SystemException { JavaEETransaction tx = javaEETM.getCurrentTransaction(); if (_logger.isLoggable(Level.FINE)) _logger.log(Level.FINE,"TM: getTransaction: tx=" + tx + ", tm=" + tmLocal.get()); if ( tx != null ) return tx; // Check for a JTS imported tx TransactionInternal jtsTx = null; TransactionManager tm = tmLocal.get(); if (tm != null) { jtsTx = (TransactionInternal)tm.getTransaction(); } if ( jtsTx == null ) return null; else { // check if this JTS Transaction was previously active // in this JVM (possible for distributed loopbacks). tx = (JavaEETransaction)globalTransactions.get(jtsTx); if (_logger.isLoggable(Level.FINE)) _logger.log(Level.FINE,"TM: getTransaction: tx=" + tx + ", jtsTx=" + jtsTx); if ( tx == null ) { tx = ((JavaEETransactionManagerSimplified)javaEETM).createImportedTransaction(jtsTx); globalTransactions.put(jtsTx, tx); } javaEETM.setCurrentTransaction(tx); // associate tx with thread return tx; } }
public Transaction suspend(JavaEETransaction tx) throws SystemException { if ( tx != null ) { if ( !tx.isLocalTx() ) suspendXA(); javaEETM.setCurrentTransaction(null); return tx; } else if (tmLocal.get() != null) { return suspendXA(); // probably a JTS imported tx } return null; }