Skip to content

Commit

Permalink
Add Transaction to lifecycle hooks for #1530 / Backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Tapac committed Jul 16, 2022
1 parent e4d18db commit e3546ed
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@ interface StatementInterceptor {
fun beforeExecution(transaction: Transaction, context: StatementContext) {}
fun afterExecution(transaction: Transaction, contexts: List<StatementContext>, executedStatement: PreparedStatementApi) {}

fun beforeCommit(transaction: Transaction) {}
fun afterCommit(transaction: Transaction) {}
fun beforeCommit(transaction: Transaction) { beforeCommit() }

@Deprecated("using beforeCommit with transaction")
//@Deprecated("using beforeCommit with transaction", level = DeprecationLevel.ERROR) \\ next version
//@Deprecated("using beforeCommit with transaction", level = DeprecationLevel.HIDDEN) \\ next version, backward compatibility
fun beforeCommit() {}
fun afterCommit(transaction: Transaction) { afterCommit() }

@Deprecated("using afterCommit with transaction")
//@Deprecated("using afterRollback with transaction", level = DeprecationLevel.ERROR) \\ next version
//@Deprecated("using afterRollback with transaction", level = DeprecationLevel.HIDDEN) \\ next version, backward compatibility
fun afterCommit() {}

fun beforeRollback(transaction: Transaction) {}
fun afterRollback(transaction: Transaction) {}
Expand Down

0 comments on commit e3546ed

Please sign in to comment.