| Apache Ignite C++

Public Types | List of all members
ignite::thin::transactions::TransactionConcurrency Struct Reference

Transaction concurrency control model. More...

`#include <transaction_consts.h>`

## Public Types
enum | Type { OPTIMISTIC = 0, PESSIMISTIC = 1 }

## Detailed Description

Transaction concurrency control model.

## Member Enumeration Documentation

## ◆ Type

enum ignite::thin::transactions::TransactionConcurrency::Type

Enumerator
OPTIMISTIC | Optimistic concurrency model. In this mode all cache operations are not distributed to other nodes until Transaction::Commit() is called. In this mode one `'PREPARE'` message will be sent to participating cache nodes to start acquiring per-transaction locks, and once all nodes reply `'OK'`, a one-way `'COMMIT'` message is sent without waiting for reply. Note that in this mode, optimistic failures are only possible in conjunction with ::IGNITE_TX_ISOLATION_SERIALIZABLE isolation level. In all other cases, optimistic transactions will never fail optimistically and will always be identically ordered on all participating grid nodes.
PESSIMISTIC | Pessimistic concurrency model. In this mode a lock is acquired on all cache operations with exception of read operations in ::IGNITE_TX_ISOLATION_READ_COMMITTED mode. All optional filters passed into cache operations will be evaluated after successful lock acquisition. Whenever Transaction::Commit() is called, a single one-way `'COMMIT'` message is sent to participating cache nodes without waiting for reply. Note that there is no reason for distributed `'PREPARE'` step, as all locks have been already acquired.

The documentation for this struct was generated from the following file:

- thin-client/include/ignite/thin/transactions/transaction_consts.h