CB-1150 Data update: do rollback on error

This commit is contained in:
Serge Rider
2021-08-23 12:00:11 +03:00
parent 208ce9d4c8
commit 63b69fd800
@@ -300,6 +300,11 @@ public class WebSQLProcessor {
if (txnManager != null && txnManager.isSupportsTransactions()) {
txnManager.commit(session);
}
} catch (Exception e) {
if (txnManager != null && txnManager.isSupportsTransactions()) {
txnManager.rollback(session, null);
}
throw new DBCException("Error persisting data changes", e);
} finally {
if (revertToAutoCommit) {
txnManager.setAutoCommit(monitor, true);