Interface TransactionFinalizer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Outer transaction hook called last: after the transaction is committed or rolled back and before
the connection returns to the pool. A convenient place to finish metrics, tracing or logging.
Called whenever TransactionInitializer succeeded, and sees the final outcome,
including failures of SqlInitializer and of the commit itself:
- committed —
Okof the transaction result (Nonefornull); an exception from this finalizer cannot undo the commit, so it is logged and ignored, and the caller receives the result; - rolled back —
Errof the exception; the caller receives it, and an exception from this finalizer is added to it as suppressed.
sql are not allowed;
metadata such as Sql.readOnly() is available.-
Field Summary
Fields -
Method Summary
-
Field Details
-
NONE
Finalizer that does nothing.
-
-
Method Details
-
done
Completes the outer scope of the transaction after commit or rollback.- Parameters:
sql- database access of the transaction (queries are no longer allowed)outcome- the transaction result if committed (Nonefornull), the exception that rolled it back otherwise
-