[Bugfix] fixed not closed TX when undoCommands() fails

This commit is contained in:
Robert von Burg 2014-08-04 15:36:02 +02:00
parent c564c2b847
commit 027ee8020f
1 changed files with 11 additions and 1 deletions

View File

@ -251,7 +251,17 @@ public abstract class AbstractTransaction implements StrolchTransaction {
} catch (Exception e) {
this.txResult.setState(TransactionState.ROLLING_BACK);
undoCommands();
try {
undoCommands();
} catch (Exception e2) {
try {
rollback(txResult);
handleRollback(start);
} catch (Exception e1) {
logger.error("Failed to roll back after failing to undo commands: " + e1.getMessage(), e1);
}
handleFailure(start, e);
}
try {
rollback(txResult);
handleRollback(start);