1.

How Do I Perform Transactions In The Documentdb Api?

Answer»

The DocumentDB API supports language-integrated transactions via JavaScript-stored procedures and TRIGGERS. All database operations inside scripts are executed under SNAPSHOT isolation. If it is a single-partition collection, the execution is scoped to the collection. If the collection is partitioned, the execution is scoped to DOCUMENTS with the same partition-key value within the collection. A snapshot of the document versions (ETags) is taken at the START of the transaction and committed only if the script SUCCEEDS. If the JavaScript throws an error, the transaction is rolled back.

The DocumentDB API supports language-integrated transactions via JavaScript-stored procedures and triggers. All database operations inside scripts are executed under snapshot isolation. If it is a single-partition collection, the execution is scoped to the collection. If the collection is partitioned, the execution is scoped to documents with the same partition-key value within the collection. A snapshot of the document versions (ETags) is taken at the start of the transaction and committed only if the script succeeds. If the JavaScript throws an error, the transaction is rolled back.



Discussion

No Comment Found