public int getStatus() throws SystemException { JavaEETransaction tx = tm.getCurrentTransaction(); if ( tx != null && tx.isLocalTx()) return tx.getStatus(); else return javax.transaction.Status.STATUS_NO_TRANSACTION; }
/** * Check whether a local transaction is in progress. * * @return true if a local transaction is in progress. */ public boolean isLocalTransactionInProgress() { boolean result = false; try { JavaEETransaction txn = (JavaEETransaction) ConnectorRuntime.getRuntime().getTransaction(); if(txn != null) { result = txn.isLocalTx(); } } catch (SystemException e) { if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Exception while checking whether a local " + "transaction is in progress while using pool : " + poolInfo, e); } } return result; } /**
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; }
ConnectorXAResource connectorXARes = (ConnectorXAResource)xares; JavaEETransaction j2eetran = connectorXARes.getAssociatedTransaction(); if(j2eetran != null && j2eetran.isLocalTx()){ if(j2eetran.getStatus() == (Status.STATUS_ACTIVE)){ try{
return; if ( !tx.isLocalTx() ) // a JTS tx, can be exported return;
public void setRollbackOnly() throws IllegalStateException, SystemException { JavaEETransaction tx = transactions.get(); // START IASRI 4662745 if ( tx != null && tx.isLocalTx()){ if(monitoringEnabled){ getDelegate().getReadLock().lock(); // XXX acquireReadLock(); try{ tx.setRollbackOnly(); }finally{ getDelegate().getReadLock().unlock(); // XXX releaseReadLock(); } } else { tx.setRollbackOnly(); } } else getDelegate().setRollbackOnlyDistributedTransaction(); // probably a JTS imported tx }
try { JavaEETransaction tx = transactions.get(); if ( tx != null && tx.isLocalTx()) { if(monitoringEnabled){
public void rollback() throws IllegalStateException, SecurityException, SystemException { boolean acquiredlock=false; try { JavaEETransaction tx = transactions.get(); if ( tx != null && tx.isLocalTx()) { if(monitoringEnabled){ getDelegate().getReadLock().lock(); // XXX acquireReadLock(); acquiredlock = true; } tx.rollback(); // rollback local tx } else { try { // an XA transaction getDelegate().rollbackDistributedTransaction(); }finally{ if ( tx != null ) { ((JavaEETransactionImpl)tx).onTxCompletion(false); } } } } finally { setCurrentTransaction(null); // clear current thread's tx delegates.set(null); if(acquiredlock){ getDelegate().getReadLock().unlock(); // XXX releaseReadLock(); } } }