RDBDocumentStore: missing rollback after delete failures
@@ -1887,6 +1887,7 @@ public class RDBDocumentStore implements DocumentStore {
db.delete(connection, tmd, Collections.singletonList(id));
connection.commit();
} catch (Exception ex) {
+ this.ch.rollbackConnection(connection);
throw handleException("removing " + id, ex, collection, id);
} finally {
this.ch.closeConnection(connection);
@@ -1905,6 +1906,7 @@ public class RDBDocumentStore implements DocumentStore {
numDeleted += db.delete(connection, tmd, sublist);
connection.commit();
} catch (Exception ex) {
+ this.ch.rollbackConnection(connection);
throw handleException("removing " + ids, ex, collection, ids);
} finally {
this.ch.closeConnection(connection);
@@ -1932,6 +1934,7 @@ public class RDBDocumentStore implements DocumentStore {
numDeleted += num;
connection.commit();
} catch (Exception ex) {
+ this.ch.rollbackConnection(connection);
Set<String> ids = subMap.keySet();
throw handleException("deleting " + ids, ex, collection, ids);
} finally {
@@ -1954,6 +1957,7 @@ public class RDBDocumentStore implements DocumentStore {
numDeleted = db.deleteWithCondition(connection, tmd, conditions);
connection.commit();
} catch (Exception ex) {
+ this.ch.rollbackConnection(connection);
throw asDocumentStoreException(ex, "deleting " + collection + ": " + conditions);
} finally {
this.ch.closeConnection(connection);
