Skip to Content
0
Nov 23, 2022 at 06:40 AM

Partial commit

205 Views

Hi Team,

We have a requirement for mass edit. We need to update multiple records of an entity with the provided data.
During this update, some records could be updated successfully and some can fail (depends on the rules/conditions) .

option 1: Batching
Make Each record-update into separate request and keep all these requests into a single batch request.
This is not an optimal solution for us because
- User has an option in UI to update all the records, but in UI we don't have all the records loaded, they are loaded with pagination.
To make it work, we have to fetch all records in a separate call and prepare the batch request. This would result in serial processing at handler level.

option2: Action (with ids and data as parameters) to update the records
In cap, the transaction starts at beginning of request, and completes at the end of the request.
In our scenario, we get either all records updated successfully or all records not updated at all.
Do we have the option of starting the transaction inside handler so that we have separate transaction at line level?