Skip to content

Commit

Permalink
add rollbackBackend() method
Browse files Browse the repository at this point in the history
Change-Id: I9a870d41c0675ad79cc6118591a0ae121401afff
  • Loading branch information
javeme committed Jun 23, 2021
1 parent 071aa26 commit 4d72a1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ public void rollback() throws BackendException {
LOG.debug("Transaction rollback()...");
this.reset();
if (this.committing2Backend) {
this.committing2Backend = false;
this.store.rollbackTx();
this.rollbackBackend();
}
}

Expand Down Expand Up @@ -301,6 +300,11 @@ protected void commitMutation2Backend(BackendMutation... mutations) {
this.committing2Backend = false;
}

protected void rollbackBackend() {
this.committing2Backend = false;
this.store.rollbackTx();
}

protected BackendMutation prepareCommit() {
// For sub-class preparing data, nothing to do here
LOG.debug("Transaction prepareCommit()...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ private void commitPartOfEdgeDeletions(Map<Id, HugeEdge> removedEdges) {
try {
this.commitMutation2Backend(mutation, idxMutation);
} catch (Throwable e) {
this.store().rollbackTx();
this.rollbackBackend();
} finally {
mutation.clear();
idxMutation.clear();
Expand Down

0 comments on commit 4d72a1e

Please sign in to comment.