We have our data stored in documentdb. We do need to perform action that touch mutiple document in one transaction. Is there a way to perform a sqlserver like transaction on documentDB?
If you execute clientside actions every action is executed independent of a transaction. It is not possible to create a transaction from the client side actions.
To execute mutiple actions in one transaction you need to create a documentDB stored procedure. All actions in a document Stored Procedure are executed similar to a transaction. All actions are executed and if one of them fails, all actions are rolled backed.
For more information how to create and execute stored procedures see: https://azure.microsoft.com/en-us/documentation/articles/documentdb-programming/
Transactions are handled via stored procedures. The operations within a stored procedure will happen within a transaction.
Just note that, within a stored procedure, any documents you touch can only be within a single collection (or a single partition within a partitioned collection).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With