|
21 | 21 |
|
22 | 22 | tarantool> box.space.tester:update({3}, {{'=', 2, 'size'}, {'=', 3, 0}})
|
23 | 23 |
|
24 |
| -This is equivalent to the following SQL statement for a table that stores |
| 24 | +This is equivalent to the following SQL statement for a table that stores |
25 | 25 | primary keys in ``field[1]``:
|
26 | 26 |
|
27 | 27 | .. code-block:: SQL
|
@@ -127,6 +127,12 @@ The cooperative scheduler ensures that, in absence of yields,
|
127 | 127 | a multi-statement transaction is not preempted and hence is never aborted.
|
128 | 128 | Therefore, understanding yields is essential to writing abort-free code.
|
129 | 129 |
|
| 130 | +Sometimes while testing the transaction mechanism in Tarantool you can notice |
| 131 | +that yielding after ``box.begin()`` but before any read/write operation does not |
| 132 | +cause an abort as it should according to the description. This happens because |
| 133 | +actually ``box.begin()`` does not start a transaction. It is a mark telling |
| 134 | +Tarantool to start a transaction after some database request that follows. |
| 135 | + |
130 | 136 | .. note::
|
131 | 137 |
|
132 | 138 | You can’t mix storage engines in a transaction today.
|
@@ -158,6 +164,10 @@ Many functions in modules :ref:`fio <fio-section>`, :ref:`net_box <net_box-modul
|
158 | 164 | :ref:`console <console-module>` and :ref:`socket <socket-module>`
|
159 | 165 | (the "os" and "network" requests) yield.
|
160 | 166 |
|
| 167 | +That is why executing separate commands such as ``select()``, ``insert()``, |
| 168 | +``update()`` in the console inside a transaction will cause an abort. This is |
| 169 | +due to implicit yield happening after each chunk of code is executed in the console. |
| 170 | + |
161 | 171 | **Example #1**
|
162 | 172 |
|
163 | 173 | * *Engine = memtx* |br|
|
|
0 commit comments