Using Update Batching for entity objects
When multiple entity objects of the same type are modified, the number of DML (INSERT, UPDATE
, and DELETE)
statements that are issued against the database corresponds to one for each entity object that was modified. This can be optimized by using entity object update batching optimization. When update batching is used, the DML statements are grouped per DML statement type (INSERT, UPDATE
, and DELETE)
and bulk-posted based on a configured threshold value. This threshold value indicates the number of entity objects of the same type that would have to be modified before update batching can be triggered.
In this recipe, we will see how to enable update batching for an entity object.
Getting ready
We will enable update batching for the Department
entity object. This entity object is part of the HRComponents
workspace, which was created in Overriding remove() to delete associated children entities, Chapter 2,Dealing with Basics:Entity Objects.
The HRComponents...