Ejemplo n.º 1
0
 /**
  * Rollback a transaction
  *
  * @exception SystemException Thrown if an error occurs
  */
 public void rollbackTransaction() throws SystemException {
   Long key = Long.valueOf(Thread.currentThread().getId());
   TransactionImpl tx = txs.get(key);
   if (tx != null) {
     try {
       tx.rollback();
     } catch (Throwable t) {
       SystemException se = new SystemException("Error during rollback");
       se.initCause(t);
       throw se;
     } finally {
       txs.remove(key);
     }
   } else {
     throw new IllegalStateException("No transaction to rollback");
   }
 }