public static final class TransactionOptions.Builder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
TransactionOptions |
build()
Build the transaction options instance.
|
TransactionOptions.Builder |
maxCommitTime(java.lang.Long maxCommitTime,
java.util.concurrent.TimeUnit timeUnit)
Sets the maximum execution time on the server for the commitTransaction operation.
|
TransactionOptions.Builder |
readConcern(ReadConcern readConcern)
Sets the read concern.
|
TransactionOptions.Builder |
readPreference(ReadPreference readPreference)
Sets the read preference.
|
TransactionOptions.Builder |
writeConcern(WriteConcern writeConcern)
Sets the write concern.
|
public TransactionOptions.Builder readConcern(@Nullable ReadConcern readConcern)
readConcern
- the read concernpublic TransactionOptions.Builder writeConcern(@Nullable WriteConcern writeConcern)
writeConcern
- the write concern, which must be acknowledgedpublic TransactionOptions.Builder readPreference(@Nullable ReadPreference readPreference)
readPreference
- the read preference, which currently must be primary. This restriction may be relaxed in future versions.public TransactionOptions.Builder maxCommitTime(@Nullable java.lang.Long maxCommitTime, java.util.concurrent.TimeUnit timeUnit)
maxCommitTime
- the max commit time, which must be either null or greater than zero, in the given time unittimeUnit
- the time unit, which may not be nullpublic TransactionOptions build()
TransactionOptions
Copyright © 2010 - 2023 Adobe. All Rights Reserved