From eb9a4368fc2eae1cd51dcf9827a915c7844a9db6 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Wed, 13 Nov 2024 15:53:15 +0100 Subject: [PATCH] [jOOQ/jOOQ#17622] Add TransactionContext.result(): Object to allow for accessing the result of a transactionResult() call from a TransactionListener --- .../java/org/jooq/TransactionContext.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/jOOQ/src/main/java/org/jooq/TransactionContext.java b/jOOQ/src/main/java/org/jooq/TransactionContext.java index 82c0cbe211..a2c76edca6 100644 --- a/jOOQ/src/main/java/org/jooq/TransactionContext.java +++ b/jOOQ/src/main/java/org/jooq/TransactionContext.java @@ -67,6 +67,27 @@ public interface TransactionContext extends Scope { @NotNull TransactionContext transaction(Transaction transaction); + /** + * The result of a {@link TransactionalCallable} or + * {@link ContextTransactionalCallable}, if the transaction has completed + * successfully. + * + * @return The result. May be null if the transaction hasn't + * completed yet, or if there was no result (e.g. in a + * {@link TransactionalRunnable} or + * {@link ContextTransactionalRunnable}), or if the result is + * null. + */ + @Nullable + Object result(); + + /** + * Set the result of the {@link TransactionalCallable} or + * {@link ContextTransactionalCallable}. + */ + @NotNull + TransactionContext result(Object result); + /** * The exception that has caused the rollback. *