Skip to content

Commit

Permalink
Use java.lang.Error when unexpected condition occurs during rollback.
Browse files Browse the repository at this point in the history
  • Loading branch information
afs committed Mar 1, 2019
1 parent 220aa27 commit 98caf7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,9 @@ private void executeCommitWriter(Transaction transaction, Runnable commit, Runna
throw new TransactionException("Exception during 'commit' - transaction rollback.", ex);
}
// Very bad. (This have been dealt with already and should get to here.)
SysErr.error("Transaction rollback failed. System unstable.");
throw new TransactionException("Exception during 'rollback' - System unstable.", ex);
SysErr.error("Transaction rollback failed. System unstable."+
"\nPlease contact [email protected], giving details of the environment and this incident.");
throw new Error("Exception during 'rollback' - System unstable.", ex);
}
catch (Throwable ex) {
SysErr.warn("Unexpected Throwable during 'commit' : transaction may have committed. Attempting rollback: ",ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,9 @@ private void writerPrepareCommit() {
throw new TDBTransactionException("Exception during 'commit' - transaction rollback.", ex);
}
// Very bad. (This should not happen and have been dealt with already.)
SystemTDB.errlog.error("Transaction rollback failed. System unstable.");
throw new TDBTransactionException("Exception during 'rollback' - System unstable.", ex);
SystemTDB.errlog.error("Transaction rollback failed. System unstable."+
"\nPlease contact [email protected], giving details of the environment and this incident.");
throw new Error("Exception during 'rollback' - System unstable.", ex);
}
catch (Throwable ex) {
SystemTDB.errlog.warn("Unexpected Throwable during 'commit' : transaction may have committed. Attempting rollback: ",ex);
Expand Down Expand Up @@ -302,7 +303,7 @@ public void abort() {
case WRITE :
if ( state != TxnState.ACTIVE )
throw new TDBTransactionException("Transaction has already committed or aborted");
// Application abort. Didn't startwriing to the journal.
// Application abort. Didn't start writing to the journal.
rollback();
break;
}
Expand Down

0 comments on commit 98caf7d

Please sign in to comment.