Class TransactionConfigBuilder
A class for configuring transactions options.
Inherited Members
Namespace: Couchbase.Transactions.Config
Assembly: Couchbase.Transactions.dll
Syntax
public class TransactionConfigBuilder
Methods
| Improve this Doc View SourceBuild()
Generate a TransactionConfig from the values provided.
Declaration
public TransactionConfig Build()
Returns
Type | Description |
---|---|
TransactionConfig | A TransactionConfig that has been initialized with the given values. |
CleanupClientAttempts(Boolean)
Controls where any transaction attempts made by this client are automatically removed.
Declaration
public TransactionConfigBuilder CleanupClientAttempts(bool cleanupClientAttempts)
Parameters
Type | Name | Description |
---|---|---|
Boolean | cleanupClientAttempts | Whether to cleanup attempts made by this client. |
Returns
Type | Description |
---|---|
TransactionConfigBuilder | The builder. |
CleanupLostAttempts(Boolean)
Controls where a background process is created to cleanup any 'lost' transaction attempts.
Declaration
public TransactionConfigBuilder CleanupLostAttempts(bool cleanupLostAttempts)
Parameters
Type | Name | Description |
---|---|---|
Boolean | cleanupLostAttempts | Whether to cleanup lost attempts from other clients. |
Returns
Type | Description |
---|---|
TransactionConfigBuilder | The builder. |
CleanupWindow(TimeSpan)
Each client that has cleanupLostAttempts(true) enabled, will be participating in the distributed cleanup process. This involves checking all ATRs every cleanup window, and this parameter controls the length of that window.
Declaration
public TransactionConfigBuilder CleanupWindow(TimeSpan cleanupWindow)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | cleanupWindow | The length of the cleanup window. |
Returns
Type | Description |
---|---|
TransactionConfigBuilder | The builder. |
Create()
Create an instance of the config.
Declaration
public static TransactionConfigBuilder Create()
Returns
Type | Description |
---|---|
TransactionConfigBuilder | An instance of the TransactionConfigBuilder. |
DurabilityLevel(DurabilityLevel)
The writes of all transactions created by this object will be performed with this durability setting.
Declaration
public TransactionConfigBuilder DurabilityLevel(DurabilityLevel durabilityLevel)
Parameters
Type | Name | Description |
---|---|---|
Couchbase.KeyValue.DurabilityLevel | durabilityLevel | A value from the DurabilityLevel(DurabilityLevel) enum. |
Returns
Type | Description |
---|---|
TransactionConfigBuilder | The builder. |
ExpirationTime(TimeSpan)
Set the ExpirationTime value.
Declaration
public TransactionConfigBuilder ExpirationTime(TimeSpan expirationTime)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | expirationTime | The maximum time that transactions created by this Transactions object can run for, before expiring. |
Returns
Type | Description |
---|---|
TransactionConfigBuilder | The builder. |
KeyValueTimeout(TimeSpan)
Set the default timeout used for all KV writes.
Declaration
public TransactionConfigBuilder KeyValueTimeout(TimeSpan keyValueTimeout)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | keyValueTimeout | The default timeout used for all KV writes. |
Returns
Type | Description |
---|---|
TransactionConfigBuilder | The builder. |
LoggerFactory(ILoggerFactory)
The ILoggerFactory to be used for logging in the Transactions internals.
Declaration
public TransactionConfigBuilder LoggerFactory(ILoggerFactory loggerFactory)
Parameters
Type | Name | Description |
---|---|---|
ILoggerFactory | loggerFactory | The logger factory. |
Returns
Type | Description |
---|---|
TransactionConfigBuilder | The builder. |
MetadataCollection(ICouchbaseCollection)
Set Couchbase.KeyValue.ICouchbaseCollection to use for Active Transaction Record metadata.
Declaration
public TransactionConfigBuilder MetadataCollection(ICouchbaseCollection metadataCollection)
Parameters
Type | Name | Description |
---|---|---|
Couchbase.KeyValue.ICouchbaseCollection | metadataCollection | The collection to use. |
Returns
Type | Description |
---|---|
TransactionConfigBuilder | The builder. |
Remarks
If this is not set, then the metadata collection will be chosen based on the VBucket of the first document modification in the transaction.
QueryConfig(TransactionQueryConfigBuilder)
Configuration builder for values related to Query.
Declaration
public TransactionConfigBuilder QueryConfig(TransactionQueryConfigBuilder queryConfigBuilder)
Parameters
Type | Name | Description |
---|---|---|
TransactionQueryConfigBuilder | queryConfigBuilder | A TransactionQueryConfigBuilder to configure query options for transactions. |
Returns
Type | Description |
---|---|
TransactionConfigBuilder | The original TransactionConfigBuilder. |