Skip to content

Commit 2272a23

Browse files
committed
update example section
1 parent 7380add commit 2272a23

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

source/write/transactions.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,10 @@ through the following steps:
109109

110110
1. Create a session from the client by using the ``startSession()`` method.
111111
#. Use the ``withTransaction()`` method to start a transaction.
112-
#. Insert multiple documents. The ``withTransaction()`` method runs the
113-
insert operation and commits the transaction. If any operation results in
114-
errors, ``withTransaction()`` cancels the transaction.
112+
#. Insert multiple documents into the ``restaurants`` collection. The
113+
``withTransaction()`` method runs the insert operation and commits the
114+
transaction. If any operation results in errors, ``withTransaction()``
115+
cancels the transaction.
115116
#. Close the connection to the server by using the ``client.close()`` method.
116117

117118
.. literalinclude:: /includes/write/transaction.kt
@@ -121,6 +122,9 @@ through the following steps:
121122
:copyable:
122123
:dedent:
123124

125+
If you require more control over your transactions, you can use the ``startTransaction()``
126+
method. You can use this method with the ``commitTransaction()`` and ``abortTransaction()``
127+
methods described in the preceding section to manually manage the transaction lifecycle.
124128

125129
Additional Information
126130
----------------------

0 commit comments

Comments
 (0)