public boolean hasCurrentTransaction() { try { if (null == transactionManager || null == transactionManager.getTransaction()) { return false; } } catch (SystemException se) { throw new TransactionFailureException( "Error fetching transaction " + "for current thread", se); } return true; }
public Transaction getCurrentTransaction() throws NotInTransactionException { try { Transaction tx = transactionManager.getTransaction(); if (tx == null) { throw new NotInTransactionException(); } return tx; } catch (SystemException se) { throw new TransactionFailureException( "Error fetching transaction " + "for current thread", se); } }