put()
a write transaction is used. Or for example, a read transaction is used, when you count()
objects in a box. All of this is transparent to you, while you don't need to take care of it yourself.store.tx()/obx_txn_write(store)
and is active until marked successful or aborted. By default, all Box operations run in implicit transactions unless an explicit transaction is in progress on the same thread. In the latter case, multiple operations share the (explicit) transaction. This means:put
calls) in one transaction.get
, count
, and queries run inside an implicit read transaction if they are not called when already inside an explicit transaction (read or write). Note that it is illegal to put
(or do any other write operation) when inside a read transaction.