public interface ClientSession extends ClientSession
| Modifier and Type | Method and Description |
|---|---|
void |
abortTransaction()
Abort a transaction in the context of this session.
|
void |
commitTransaction()
Commit a transaction in the context of this session.
|
ServerAddress |
getPinnedServerAddress()
Returns the server address of the pinned mongos on this session.
|
TransactionOptions |
getTransactionOptions()
Gets the transaction options.
|
boolean |
hasActiveTransaction()
Returns true if there is an active transaction on this session, and false otherwise
|
boolean |
notifyMessageSent()
Notify the client session that a message has been sent.
|
void |
setPinnedServerAddress(ServerAddress address)
Pin the server address of the mongos on this session.
|
void |
startTransaction()
Start a transaction in the context of this session with default transaction options.
|
void |
startTransaction(TransactionOptions transactionOptions)
Start a transaction in the context of this session with the given transaction options.
|
<T> T |
withTransaction(TransactionBody<T> transactionBody)
Execute the given function within a transaction.
|
<T> T |
withTransaction(TransactionBody<T> transactionBody,
TransactionOptions options)
Execute the given function within a transaction.
|
advanceClusterTime, advanceOperationTime, close, getClusterTime, getOperationTime, getOptions, getOriginator, getRecoveryToken, getServerSession, isCausallyConsistent, setRecoveryToken@Nullable ServerAddress getPinnedServerAddress()
getPinnedServerAddress in interface ClientSessionvoid setPinnedServerAddress(@Nullable
ServerAddress address)
setPinnedServerAddress in interface ClientSessionaddress - the server address to pin to this sessionboolean hasActiveTransaction()
boolean notifyMessageSent()
For internal use only
TransactionOptions getTransactionOptions()
void startTransaction()
void startTransaction(TransactionOptions transactionOptions)
transactionOptions - the options to apply to the transactionvoid commitTransaction()
void abortTransaction()
<T> T withTransaction(TransactionBody<T> transactionBody)
T - the return type of the transaction bodytransactionBody - the body of the transaction<T> T withTransaction(TransactionBody<T> transactionBody, TransactionOptions options)
T - the return type of the transaction bodytransactionBody - the body of the transactionoptions - the transaction optionsCopyright © 2010 - 2023 Adobe. All Rights Reserved