Skip to content

Commit 98caf7d

Browse files
committed
Use java.lang.Error when unexpected condition occurs during rollback.
1 parent 220aa27 commit 98caf7d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

jena-db/jena-dboe-transaction/src/main/java/org/apache/jena/dboe/transaction/txn/TransactionCoordinator.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -747,8 +747,9 @@ private void executeCommitWriter(Transaction transaction, Runnable commit, Runna
747747
throw new TransactionException("Exception during 'commit' - transaction rollback.", ex);
748748
}
749749
// Very bad. (This have been dealt with already and should get to here.)
750-
SysErr.error("Transaction rollback failed. System unstable.");
751-
throw new TransactionException("Exception during 'rollback' - System unstable.", ex);
750+
SysErr.error("Transaction rollback failed. System unstable."+
751+
"\nPlease contact [email protected], giving details of the environment and this incident.");
752+
throw new Error("Exception during 'rollback' - System unstable.", ex);
752753
}
753754
catch (Throwable ex) {
754755
SysErr.warn("Unexpected Throwable during 'commit' : transaction may have committed. Attempting rollback: ",ex);

jena-tdb/src/main/java/org/apache/jena/tdb/transaction/Transaction.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,9 @@ private void writerPrepareCommit() {
219219
throw new TDBTransactionException("Exception during 'commit' - transaction rollback.", ex);
220220
}
221221
// Very bad. (This should not happen and have been dealt with already.)
222-
SystemTDB.errlog.error("Transaction rollback failed. System unstable.");
223-
throw new TDBTransactionException("Exception during 'rollback' - System unstable.", ex);
222+
SystemTDB.errlog.error("Transaction rollback failed. System unstable."+
223+
"\nPlease contact [email protected], giving details of the environment and this incident.");
224+
throw new Error("Exception during 'rollback' - System unstable.", ex);
224225
}
225226
catch (Throwable ex) {
226227
SystemTDB.errlog.warn("Unexpected Throwable during 'commit' : transaction may have committed. Attempting rollback: ",ex);
@@ -302,7 +303,7 @@ public void abort() {
302303
case WRITE :
303304
if ( state != TxnState.ACTIVE )
304305
throw new TDBTransactionException("Transaction has already committed or aborted");
305-
// Application abort. Didn't startwriing to the journal.
306+
// Application abort. Didn't start writing to the journal.
306307
rollback();
307308
break;
308309
}

0 commit comments

Comments
 (0)