public class TransactionsConfig extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TransactionsConfig.Builder |
Constructor and Description |
---|
TransactionsConfig() |
Modifier and Type | Method and Description |
---|---|
static TransactionsConfig.Builder |
builder() |
static TransactionsConfig.Builder |
cleanupConfig(TransactionsCleanupConfig.Builder config)
Configures transaction cleanup.
|
static TransactionsConfig.Builder |
durabilityLevel(com.couchbase.client.core.msg.kv.DurabilityLevel level)
All transaction writes will be performed with this durability setting.
|
static TransactionsConfig.Builder |
metadataCollection(TransactionKeyspace collection)
Allows setting a custom collection to use for any transactional metadata documents.
|
static TransactionsConfig.Builder |
queryConfig(TransactionsQueryConfig.Builder queryConfig)
Sets the default query configuration for all transactions.
|
static TransactionsConfig.Builder |
timeout(Duration timeout)
Sets the maximum time that transactions can run for.
|
public static TransactionsConfig.Builder builder()
public static TransactionsConfig.Builder cleanupConfig(TransactionsCleanupConfig.Builder config)
public static TransactionsConfig.Builder timeout(Duration timeout)
Applications can increase or decrease this as desired. The trade-off to understand is that documents that are
being mutated in a transaction A, are effectively locked from being updated by other transactions until
transaction A has completed - committed or rolled back. If transaction A is unable to complete for whatever
reason, the document can be locked for this timeout
time.
public static TransactionsConfig.Builder durabilityLevel(com.couchbase.client.core.msg.kv.DurabilityLevel level)
The default setting is DurabilityLevel.MAJORITY, meaning a transaction will pause on each write until it is available in-memory on a majority of configured replicas.
DurabilityLevel.NONE is not supported and provides no ACID transactional guarantees.
public static TransactionsConfig.Builder metadataCollection(TransactionKeyspace collection)
If not set, it will default to creating these documents in the default collection of the bucket that the first mutated document in the transaction is on.
This collection will be added to the set of collections being cleaned up.
public static TransactionsConfig.Builder queryConfig(TransactionsQueryConfig.Builder queryConfig)
queryConfig
- the query configuration to useCopyright © 2024 Couchbase, Inc.. All rights reserved.