diff options
Diffstat (limited to 'src/docs/transactions.dox')
-rw-r--r-- | src/docs/transactions.dox | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/docs/transactions.dox b/src/docs/transactions.dox index 46df3589759..33e75c63ad0 100644 --- a/src/docs/transactions.dox +++ b/src/docs/transactions.dox @@ -24,28 +24,29 @@ properties: @section transactions_api Transactional API -In WiredTiger, the transactional context is managed by the WT_SESSION -class. Applications call WT_SESSION::begin_transaction to start a new -transaction. Operations performed with that WT_SESSION handle -(including cursors already open in that WT_SESSION handle and cursors -subsequently opened before the transaction ends), are then part of the -transaction and their effects committed or discarded by calling -WT_SESSION::commit_transaction and WT_SESSION::rollback_transaction. +In WiredTiger, transaction operations are methods off the WT_SESSION +class. -Both WT_SESSION::commit_transaction and WT_SESSION::rollback_transaction -implicitly reset all open cursors. +Applications call WT_SESSION::begin_transaction to start a new +transaction. Operations subsequently performed using that WT_SESSION +handle, including operations on any cursors open in that WT_SESSION +handle, are implicitly part of the transaction and their effects +committed by calling WT_SESSION::commit_transaction, or discarded by +calling WT_SESSION::rollback_transaction. -If WT_SESSION::commit_transaction returns an error for any reason, the -transaction was rolled-back, not committed. +If WT_SESSION::commit_transaction returns an error for any reason, +the transaction was rolled-back, not committed. -@snippet ex_all.c simple transaction +When transactions are used, data operations can encounter a conflict and +fail with the ::WT_DEADLOCK error. If this error occurs, transactions +should be rolled back with WT_SESSION::rollback_transaction and retried. -When transactions are used, update operations that conflict with a -concurrent transaction will fail with the ::WT_DEADLOCK error. -Transactions should be rolled back with WT_SESSION::rollback_transaction -and retried if this error occurs. +The WT_SESSION::begin_transaction, WT_SESSION::commit_transaction and +WT_SESSION::rollback_transaction methods all implicitly reset open +cursors, as if WT_CURSOR::reset were called, discarding any object +position or key values they may have. -@snippet ex_all.c simple rollback transaction +@snippet ex_all.c transaction commit/rollback @section transactions_concurrency Concurrency control @@ -89,7 +90,7 @@ reads. The transaction isolation level can be configured on a per-transaction basis: -@snippet ex_all.c simple transaction isolation +@snippet ex_all.c transaction isolation Additionally, the default transaction isolation can be configured and re-configured on a per-session basis: |