Table of Contents

Class TransactionDbOptions

Namespace
RocksDbNet
Assembly
RocksDb.Net.dll

Settings for opening a TransactionDb. Maps to rocksdb_transactiondb_options_t.

public sealed class TransactionDbOptions : RocksDbHandle, IDisposable
Inheritance
TransactionDbOptions
Implements
Inherited Members

Remarks

These configure the lock manager shared by every transaction on the database. Per-transaction settings live on TransactionOptions. RocksDb copies these when the database opens, so this object may be disposed straight afterwards.

Constructors

TransactionDbOptions()

Creates options with RocksDb's defaults.

public TransactionDbOptions()

Properties

CommitBypassMemtableThreshold

Size in bytes above which a commit writes its data directly rather than through the memtable, or zero to disable.

public uint CommitBypassMemtableThreshold { get; set; }

Property Value

uint

DefaultLockTimeout

How long a write made outside any transaction waits for a lock, in milliseconds. Negative means wait forever.

public long DefaultLockTimeout { get; set; }

Property Value

long

Remarks

Writes through TransactionDb itself, rather than through a Transaction, still take locks. This is their timeout.

DefaultWriteBatchFlushThreshold

Default size in bytes at which a transaction's pending writes are flushed to the memtable early, or zero to disable.

public long DefaultWriteBatchFlushThreshold { get; set; }

Property Value

long

EnableUdtValidation

Whether to validate user-defined timestamps during conflict checking.

public bool EnableUdtValidation { get; set; }

Property Value

bool

MaxNumDeadlocks

How many deadlocks to keep in the reportable history buffer.

public uint MaxNumDeadlocks { get; set; }

Property Value

uint

MaxNumLocks

Maximum number of locks the manager will hold, or a negative value for no limit, which is the default.

public long MaxNumLocks { get; set; }

Property Value

long

Remarks

A transaction that would exceed the limit fails rather than blocking. Worth setting when transactions might touch an unbounded number of keys, since each locked key costs memory.

NumStripes

How many stripes the lock table is divided into. More stripes reduce contention between transactions touching unrelated keys.

public ulong NumStripes { get; set; }

Property Value

ulong

RollbackMergeOperands

Whether rolling back a transaction also rolls back merge operands it wrote.

public bool RollbackMergeOperands { get; set; }

Property Value

bool

SkipConcurrencyControl

Whether to skip locking and conflict detection entirely.

public bool SkipConcurrencyControl { get; set; }

Property Value

bool

Remarks

This removes the guarantee the database exists to provide. Only safe when the application already serialises its writes by other means, and wants transactions purely for atomicity.

TransactionLockTimeout

How long a transaction waits for a lock before failing, in milliseconds. Negative means wait forever; zero means fail immediately.

public long TransactionLockTimeout { get; set; }

Property Value

long

Remarks

The value used by transactions that do not set one of their own. It is not a ceiling: a non-negative LockTimeout replaces this outright, and may be longer than it.

UsePerKeyPointLockManager

Whether to use the per-key point lock manager rather than the striped one.

public bool UsePerKeyPointLockManager { get; set; }

Property Value

bool

WritePolicy

When a transaction's data becomes visible in the memtable. Default is WriteCommitted.

public TransactionDbWritePolicy WritePolicy { get; set; }

Property Value

TransactionDbWritePolicy

Methods

DisposeHandle()

Releases the native handle. Called during disposal.

protected override void DisposeHandle()

Remarks

Protected rather than public: it destroys the native object without marking this instance disposed or clearing the handle, so calling it from outside and then disposing normally would free the same pointer twice. It was the most Dispose-looking member on the type. Callers want Dispose().