improced commit-rollback behaviour on multi-step transactions
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -84,10 +84,16 @@ CREATE TABLE IF NOT EXISTS {0} (
|
||||
db.setAutoCommit(false);
|
||||
Query.delete().from(TABLE_TASK_TIMES).where(TIME_ID,equal(timeId)).execute(db);
|
||||
Query.delete().from(TABLE_TIMES).where(ID,equal(timeId)).execute(db);
|
||||
db.setAutoCommit(false);
|
||||
return timeId;
|
||||
} catch (SQLException e) {
|
||||
try {
|
||||
db.rollback();
|
||||
} catch (SQLException ignored) {}
|
||||
throw failedToDropObject(t(TIME_WITH_ID, ID,timeId)).causedBy(e);
|
||||
} finally {
|
||||
try {
|
||||
db.setAutoCommit(true);
|
||||
} catch (SQLException ignored){};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user