Child pages
  • Define transactions
Skip to end of metadata
Go to start of metadata

Transactional operations

Apstrata allows you to run multiple operations on the documents of your store within transactional boundaries. When executing operations in a transaction, Asptrata "write-locks" the corresponding documents and applies the effect of the operations as soon as the transaction is committed (i.e. validated), or discards it if the transaction is rolled-back (i.e. invalidated). Transactions can be created from within your Apstrata server-side scripts or from the client side, by invoking the Transaction API, however, it is preferable to only create them in your scripts.

Back to the map   Next station: set permissions

Example: create a new game instance and save the player's name and location

You are developing a cool mobile game. Let us imagine that whenever a player creates a new instance of this game, you would like to save the instance status and the player's name and location in two distinct documents. However, you also need to make sure that both documents get created together, so you do not end up with orphan games. Let us see how to do this using an Apstrata script.


Navitabs License Error

The number of licensed users is incompatible with the number of licensed users of Confluence. Please contact your system administrator.

License Details
Try it!

Dig deeper

Related tutorials