Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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);
   }
 }