Top Description Methods
org.jooq

public Interface TransactionalCallable<T>

Annotations
@FunctionalInterface
Imports
java.util.Arrays, .Collection, java.util.stream.Collector

An FunctionalInterface that wraps transactional code.

Transactional code should not depend on any captured scope, but use the argument Configuration passed to the run(Configuration) method to derive its transaction context.

If transactional code needs to depend on captured scope ("context"), then ContextTransactionalCallable is a better fit.

Author
Lukas Eder

Method Summary

Modifier and TypeMethod and Description
public static <T> TransactionalCallable<T>
of(TransactionalCallable<T>... callables)

Wrap a set of nested TransactionalCallable objects in a single global TransactionalCallable, returning the last callable's result.

public static <T> TransactionalCallable<T>
of(Collection<? extends TransactionalCallable<T>> callables)

Wrap a set of nested TransactionalCallable objects in a single global TransactionalCallable, returning the last callable's result.

public static <T, R> TransactionalCallable<R>
of(TransactionalCallable<T>[] callables, Collector<T, ?, R> collector)

Wrap a set of nested TransactionalCallable objects in a single global TransactionalCallable, collecting the callables' results.

public static <T, R> TransactionalCallable<R>
of(Collection<? extends TransactionalCallable<T>> callables, Collector<T, ?, R> collector)

Wrap a set of nested TransactionalCallable objects in a single global TransactionalCallable, collecting the callables' results.

public T

Returns:

The outcome of the transaction.
run
(Configuration
The Configuration in whose context the transaction is run.
configuration
)

Run the transactional code.

Method Detail

ofback to summary
public static <T> TransactionalCallable<T> of(TransactionalCallable<T>... callables)

Wrap a set of nested TransactionalCallable objects in a single global TransactionalCallable, returning the last callable's result.

Annotations
@SafeVarargs
ofback to summary
public static <T> TransactionalCallable<T> of(Collection<? extends TransactionalCallable<T>> callables)

Wrap a set of nested TransactionalCallable objects in a single global TransactionalCallable, returning the last callable's result.

ofback to summary
public static <T, R> TransactionalCallable<R> of(TransactionalCallable<T>[] callables, Collector<T, ?, R> collector)

Wrap a set of nested TransactionalCallable objects in a single global TransactionalCallable, collecting the callables' results.

ofback to summary
public static <T, R> TransactionalCallable<R> of(Collection<? extends TransactionalCallable<T>> callables, Collector<T, ?, R> collector)

Wrap a set of nested TransactionalCallable objects in a single global TransactionalCallable, collecting the callables' results.

runback to summary
public T run(Configuration configuration) throws Throwable

Run the transactional code.

If this method completes normally, and this is not a nested transaction, then the transaction will be committed. If this method completes with an exception (any Throwable), then the transaction is rolled back to the beginning of this TransactionalCallable.

Parameters
configuration:Configuration

The Configuration in whose context the transaction is run.

Returns:T

The outcome of the transaction.

Exceptions
Throwable:
Any exception that will cause a rollback of the code contained in this transaction. If this is a nested transaction, the rollback may be performed only to the state before executing this TransactionalCallable.