I have a list of Products which have to be added to a Purchase Order. The Purchase order has a sequence number and once the Products are added, their status should be changed to indicate that these are out for purchase.
The typical number of Products being processed in 1 Purchase Order would be 500.
On the DB - I have 2 tables -> 1 for Products and another for Purchase Orders. Which means I need 500 updates and 1 insert to be done. When I try to do this in a BatchStatement I get the error - Batch too large.
Suggestions from various quarters tell me that I should use multiple async queries. My concern however is atomicity of the entire operation. Please suggest what would be the best way forward given my requirement.
Thanks in advance.