public class TransactionResult
extends java.lang.Object
Note that the success or failure of a transaction is determined solely by whether an a TransactionFailed
exception is thrown by it.
Modifier and Type | Method and Description |
---|---|
java.util.List<TransactionAttempt> |
attempts()
A transaction consists of one or more attempts to commit the provided transaction logic.
|
TransactionLogger |
log()
An in-memory log is built up during each transaction.
|
com.couchbase.client.java.kv.MutationState |
mutationState()
Returns the final
MutationState for each document involved in the transaction, after it's committed or rolled
back. |
java.util.List<com.couchbase.client.core.msg.kv.MutationToken> |
mutationTokens()
Returns the final mutation token for each document involved in the transaction, after it's committed or rolled
back.
|
java.util.Optional<TransactionSerializedContext> |
serialized()
Returns a serialized representation of a deferred transaction, suitable for later commit or rollback.
|
java.time.Duration |
timeTaken()
Returns the total time taken by a transaction.
|
java.lang.String |
toString() |
java.lang.String |
transactionId()
Returns the id of this transaction.
|
boolean |
unstagingComplete()
Returns whether all documents were successfully unstaged.
|
public TransactionLogger log()
public java.util.List<TransactionAttempt> attempts()
public java.time.Duration timeTaken()
public java.lang.String transactionId()
public java.util.List<com.couchbase.client.core.msg.kv.MutationToken> mutationTokens()
@Stability.Volatile public java.util.Optional<TransactionSerializedContext> serialized()
AttemptContext.defer()
on the transaction.public com.couchbase.client.java.kv.MutationState mutationState()
MutationState
for each document involved in the transaction, after it's committed or rolled
back.
This can be used to ensure consistency with N1QL and FTS queries.
It should be disregarded if the transaction did not successfully complete, e.g. if it threw an exception.
Note: Mutation tokens must be enabled on the Cluster configuration in order for this to be non-empty.public boolean unstagingComplete()
public java.lang.String toString()
toString
in class java.lang.Object