File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -185,13 +185,16 @@ end the transaction. You can use the ``commit_transaction()`` and
185185``abort_transaction()`` methods on the session instance to manage the
186186transaction lifecycle.
187187
188- This example demonstrates how to use the low-level transaction API
189- to perform the following actions:
188+ Example
189+ ~~~~~~~
190+
191+ This example uses the low-level transaction API to perform the following
192+ actions:
190193
191- - Create a session
192- - Start a transaction
193- - Perform data operations
194- - Commit the transaction, or end it if there are errors
194+ 1. Creates a session
195+ #. Starts a transaction
196+ #. Performs data operations
197+ #. Commits the transaction, or ends it if there are errors
195198
196199.. literalinclude:: /includes/interact-data/transaction.rb
197200 :start-after: start-lower-lvl-api
@@ -204,6 +207,9 @@ to perform the following actions:
204207 If a session ends and includes an open transaction, the transaction is
205208 automatically ended.
206209
210+ Transaction Retry
211+ ~~~~~~~~~~~~~~~~~
212+
207213You can retry the transaction commit if it fails initially. The
208214following example demonstrates how to retry the transaction when {+odm+}
209215raises the ``UNKNOWN_TRANSACTION_COMMIT_RESULT_LABEL`` exception:
@@ -214,6 +220,9 @@ raises the ``UNKNOWN_TRANSACTION_COMMIT_RESULT_LABEL`` exception:
214220 :language: ruby
215221 :dedent:
216222
223+ Options
224+ ~~~~~~~
225+
217226You can specify a read concern, write concern or read
218227preference when starting a transaction by passing options to the
219228``start_transaction()`` method:
You can’t perform that action at this time.
0 commit comments