예제 #1
0
 public Transaction getTransaction() {
   if (txn.getState() == DummyTransaction.State.ACTIVE) {
     return txn;
   } else {
     throw new TransactionNotActiveException("Transaction is not active");
   }
 }
예제 #2
0
 public void abort(Throwable cause) {
   if (txn.getState() == DummyTransaction.State.ACTIVE) {
     txn.abort(cause);
   } else {
     // TODO: Maybe chaeck the exception that caused the
     // abort in order to throw an exception with the right
     // retry status.
     throw new TransactionNotActiveException("Transaction is not active");
   }
 }