minivac
06/19/2024, 3:35 PMStatementInterceptor.afterExecution
is called for each retry tooChantal Loncle
06/21/2024, 2:49 AMafterExecution
is called after each statement is completed in a transaction, so it may be called multiple times in a single transaction if that transaction contains multiple SQL statements.
So if maxAttempts
for example is set to more than 1, afterExecution()
will be called for each successful statement, on each attempt.
If the number of statements in the transaction is potentially greater than 1, afterCommit()
may be the better option depending on your use case.
It is only implicitly called once, after a transaction has finally completed successfully, regardless of the number of attempts.
Please note that afterCommit()
will also be called if commit()
is explicitly used in the transaction, as well as if the transaction includes a create table statement.
And it will not be called at the end if the transaction ultimately fails all attempts.