Skip to content

fixes gh-399 add notes about transactions #1176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion doc/book/box/atomic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ query:

tarantool> box.space.tester:update({3}, {{'=', 2, 'size'}, {'=', 3, 0}})

This is equivalent to the following SQL statement for a table that stores
This is equivalent to the following SQL statement for a table that stores
primary keys in ``field[1]``:

.. code-block:: SQL
Expand Down Expand Up @@ -127,6 +127,12 @@ The cooperative scheduler ensures that, in absence of yields,
a multi-statement transaction is not preempted and hence is never aborted.
Therefore, understanding yields is essential to writing abort-free code.

Sometimes while testing the transaction mechanism in Tarantool you can notice
that yielding after ``box.begin()`` but before any read/write operation does not
cause an abort as it should according to the description. This happens because
actually ``box.begin()`` does not start a transaction. It is a mark telling
Tarantool to start a transaction after some database request that follows.

.. note::

You can’t mix storage engines in a transaction today.
Expand Down Expand Up @@ -158,6 +164,10 @@ Many functions in modules :ref:`fio <fio-section>`, :ref:`net_box <net_box-modul
:ref:`console <console-module>` and :ref:`socket <socket-module>`
(the "os" and "network" requests) yield.

That is why executing separate commands such as ``select()``, ``insert()``,
``update()`` in the console inside a transaction will cause an abort. This is
due to implicit yield happening after each chunk of code is executed in the console.

**Example #1**

* *Engine = memtx* |br|
Expand Down