Skip to content

Commit 24e68c4

Browse files
committed
page fmt
1 parent d6eb221 commit 24e68c4

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

source/interact-data/transaction.txt

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff 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
186186
transaction 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+
207213
You can retry the transaction commit if it fails initially. The
208214
following example demonstrates how to retry the transaction when {+odm+}
209215
raises 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+
217226
You can specify a read concern, write concern or read
218227
preference when starting a transaction by passing options to the
219228
``start_transaction()`` method:

0 commit comments

Comments
 (0)