public interface ReadTransactionContext
ReadTransaction is available for database operations. The
behavior of the methods specified in this interface, especially in the face
errors, is implementation specific. In particular, some implementations will
run Functions multiple times (retry) when certain errors are encountered.
Therefore a Function should be prepared to be called more than once. This
consideration means that a Function should use caution when directly
modifying state in a class, especially in a way that could be observed were that
Function to not complete successfully.| Modifier and Type | Method and Description |
|---|---|
<T> T |
read(Function<? super ReadTransaction,T> retryable)
Runs a function in this context that takes a read-only transaction.
|
<T> T |
read(PartialFunction<? super ReadTransaction,T> retryable)
Runs a function in this context that takes a read-only transaction.
|
<T> Future<T> |
readAsync(Function<? super ReadTransaction,Future<T>> retryable)
Runs a function in this context that takes a read-only transaction.
|
<T> PartialFuture<T> |
readAsync(PartialFunction<? super ReadTransaction,? extends PartialFuture<T>> retryable)
Runs a function in this context that takes a read-only transaction.
|
<T> T read(Function<? super ReadTransaction,T> retryable)
retryable - the block of logic to execute against a ReadTransaction
in this contextretryable<T> T read(PartialFunction<? super ReadTransaction,T> retryable) throws Exception
read(Function) if the called user code throws checked exceptions.retryable - the block of logic to execute against a ReadTransaction
in this contextretryableExceptionread(Function)<T> Future<T> readAsync(Function<? super ReadTransaction,Future<T>> retryable)
Future that will be set when the process is complete.retryable - the block of logic to execute against a ReadTransaction
in this contextFuture that will be set to the value returned by the last call
to retryable<T> PartialFuture<T> readAsync(PartialFunction<? super ReadTransaction,? extends PartialFuture<T>> retryable)
readAsync(Function) if the called user code throws checked exceptions.retryable - the block of logic to execute against a ReadTransaction
in this contextPartialFuture that will be set to the value returned by the last call
to retryable