Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens if one operation of TableBatchOperation fails?

When executing a batch, if one of the operation of TableBatchOperation fails:

  1. Every operations in the batch are canceled
  2. Every other operations that are valid are processed
  3. The first valid operations in the queue are processed until one operation fails, and following ones are not processed
like image 913
uzul Avatar asked Jan 18 '13 13:01

uzul


2 Answers

Answer is 1 - Even if one operation fails in the batch, the entire operation fails (or in other words rolls back). This is similar to performing transactions in a relational database. What's interesting is that you get an index of the failed entity in the response when this happens. Check this thread for more details: Azure CloudTable.ExecuteBatch(TableBatchOperation) throws a storageexception. How can I find which operation(s) caused the exception?

like image 100
Gaurav Mantri Avatar answered Dec 12 '22 15:12

Gaurav Mantri


Official blog post: http://blogs.msdn.com/b/windowsazurestorage/archive/2012/11/06/windows-azure-storage-client-library-2-0-tables-deep-dive.aspx

TableBatchOperations, or Entity Group Transactions, are executed atomically meaning that either all operations will succeed or if there is an error caused by one of the individual operations the entire batch will fail.

like image 32
Sandrino Di Mattia Avatar answered Dec 12 '22 15:12

Sandrino Di Mattia