Atomicity for Bulk Updates

GemFire XD does not validate the constraints for all affected rows before applying a bulk update (a single DML statement that updates or inserts multiple rows). The design is optimized for applications where such violations are rare.

A constraint violation exception (or any other exception) that is thrown during a bulk update operation does not indicate which row of the bulk update caused a violation. Applications that receive any such exception cannot determine whether any rows in the bulk operation updated successfully.

To address the possibility of constraint violations or exceptions occurring during a bulk update, an application should always apply a bulk update within the scope of a transaction. Using a transaction is the only way to ensure that all rows are either updated or rolled back as a unit. As an alternative, the application should select rows for updating based on primary keys, and apply those updates one at a time.

In addition, without using a transaction, concurrent DML operations (bulk updates or otherwise) can modify qualified rows, giving incorrect results to both the operations. Use transactions where necessary to ensure that a bulk update operation completes or rolls back as a whole.