19 Reports
Program Management Module(PMM): Rowlock errors when creating multiple Service Deliveries through the Bulk Service Deliveries tab 'Create by Group'
Created
Last Updated
Reference ID
W-14633962
Summary
When creating Service Deliveries through the Bulk Service Delivery interface, you may often receive a Rowlock Error during the execution of Class.pmdm.ServiceDeliveryRollupsService.processChanges, which appears to be locking the Service record when rolling up the Service Deliveries.
Steps to Reproduce
Log into an your org where PMM is installed
Make sure "Rollup Service Deliveries to Service Feature" is active in Custom Metadata under "Feature Gate"
Go to App Launcher and search for Bulk Service Deliveries and click on it
Select "Create By Group" option
Try filling in the necessary details and try to create 6 or more service deliveries for the same service
You'll notice the below error.
ERROR:
pmdm.ServiceDeliveryTrigger: execution of AfterInsert caused by: System.DmlException: Update failed. First exception on row 0 with id a2v4O000005RXBbQAO; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record or 1 records: a2v4O000005RXBbQAO: [] (System Code)
NOTE: This issue is intermittent
Workaround
Disabling the 'Roll Up Service Deliveries to Service' feature in Custom Metadata - Feature Gate and run the Service Rollup updates on a schedule instead to calculate the rollups.
To disable the Roll Up Service Deliveries to Service:
Goto Setup > Search for Custom Metadata in quick find and Click on it > Select Feature Gate and click Manage > Edit and disable "Roll Up Service Deliveries to Service".
To Create a Scheduled Job to Recalculate Service Delivery Summary Fields:
From Setup, in the Quick Find box, enter Apex Classes, and then select Apex Classes.
Enter a Job Name. For example, Service Delivery to Contact Rollup.
Select the Apex class "ServiceRollupsSchedulable"
Specify a Frequency, Start and End times, and Preferred Start Time. We recommend a Start Time when users won’t be working with Service Delivery records.
Click Save
To verify your scheduled job, enter then select Scheduled Jobs in the Quick Find box
19 Reports