@FunctionalInterface public interface TransactionFunction<R> extends java.util.function.Function<Transaction,R>
Connection
's
runTransaction. This can neatly be done inline using a lambda expression. The transaction may be
automatically run several times if the server rejects the transaction for various reasons.
Therefore your transaction must not have any side effects until after the transaction has
committed (or you have chosen for the transaction to abort).Modifier and Type | Method and Description |
---|---|
R |
apply(Transaction txn)
The callback invoked (potentially several times) to run your transaction.
|
R apply(Transaction txn)
TransactionAbortedException
from within the
transaction.apply
in interface java.util.function.Function<Transaction,R>
txn
- The API through which your transaction can navigate and interact with the
object-graph stored by GoshawkDB.