Skip to content

Commit

Permalink
增加beforeCommit帮助方法
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Jul 31, 2024
1 parent fbdf2cd commit a5b6f6b
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ default void removeTransactionListener(String txnGroup, ITransactionListener lis
}
}

default void beforeCommit(String txnGroup, Runnable action) {
addTransactionListener(txnGroup, new ITransactionListener() {
@Override
public void onBeforeCommit(ITransaction txn) {
action.run();
}
});
}

default void afterCommit(String txnGroup, Runnable action) {
addTransactionListener(txnGroup, new ITransactionListener() {
@Override
Expand Down

0 comments on commit a5b6f6b

Please sign in to comment.