private void commitCurrentTransaction() throws Exception {
    if (currentTransaction != null) {
      try {
        currentTransaction.commit();
      } catch (RollbackException t) {

        // Throwing the real error
        Throwable realT = t.getStatus().getException();
        if (realT instanceof Exception) throw (Exception) realT;
      }
      currentTransaction = null;
    }
  }
 private void startNewTransaction(
     InternalTransactionalEditingDomain editingDomain, RecordingCommand command)
     throws InterruptedException {
   currentTransaction = createTransaction(editingDomain, command);
   currentTransaction.start();
 }