MarkLogic XCC/.Net Library

Session.TransactionMode Property

Set or get the transaction mode. The initial value is TransactionMode.Auto.

If the transaction mode is TransactionMode.Auto, a new transaction is created for every request, and committed (or rolled back) at the end of that request. The type of transaction created is determined automatically by query analysis.

If transaction mode is TransactionMode.Query or TransactionMode.Update, requests are grouped under transactions bounded by calls to Session.Commit() or Session.Rollback(). If transaction mode is TransactionMode.Query, then a read-only query transaction is created to group requests. If transaction mode is TransactionMode.Update, then a locking update transaction is created. If an updating request is executed under a read-only TransactionMode.Query transaction, a RequestException is thrown.

Setting TransactionMode while a transaction is active has no effect on the current transaction.

[Visual Basic]
Property TransactionMode As TransactionMode
[C#]
TransactionMode TransactionMode {get; set;}

See Also

Session Interface | Marklogic.Xcc Namespace