sfdc-trigger-framework icon indicating copy to clipboard operation
sfdc-trigger-framework copied to clipboard

Framework is not able to handle bulk dataset

Open vinodpalne opened this issue 5 years ago • 7 comments
trafficstars

Hi @kevinohara80 I am using the Trigger framework but stuck at a point where I have to deal with bulk data. The framework is consuming a lot of CPU time. The trigger doesn't have any complex logic it simply needs to set field value in before event for approx 4k records.

Can you please help me to get out of this exception.

Any help would be appreciated.

Thank You.

vinodpalne avatar Nov 24 '19 10:11 vinodpalne

Can you please post your full trigger, and a log of it failing with 4K records?

I’ve used this with large data volume orgs and data imports of 18k records without error.

codefriar avatar Nov 24 '19 14:11 codefriar

@kevinohara80 Please find the attached log file and trigger.

apex-07L4J000002ZxX3UAK.log

AccountTriggerHandler.txt

vinodpalne avatar Nov 24 '19 15:11 vinodpalne

@vinodpalne Try this same experiment with a new custom object instead of Account. There isn't much happening in the log between the ~600ms jump in CPU. This makes me think the CPU is being used by SF processes (possibly building/checking indexes for a unique field), and not the framework.

davehelgerson avatar Nov 24 '19 18:11 davehelgerson

@davehelgerson @kevinohara80 Hi Friends, Attached are logs with framework & without this trigger framework. hope this clarifies issue. FYI,, I tested this for 2000 Account UPDATE operation on anonymous apex execute. The beforeupdate and afterupdate() trigger methods are blank/empty. without_FW.log with_FW.log

jayantsandeibm avatar Nov 25 '19 11:11 jayantsandeibm

attaching apex execution log for the same Screenshot 2019-11-25 at 13 16 31

jayantsande25 avatar Nov 25 '19 13:11 jayantsande25

Can you post your Trigger body?

kevinohara80 avatar Dec 04 '19 18:12 kevinohara80

Hi Kevin,

The trigger body has been uploaded to issue AccountTriggerHandler.txt https://github.com/kevinohara80/sfdc-trigger-framework/files/3883761/AccountTriggerHandler.txt along with the log.

Not sure if we can perform any optimisation in the framework itself? If client has heavy execution logic e.g. Crypto.generateAesKey() it's likely failure. Though, I do see benefits of your framework to handle recursion, bypass triggers etc when data volume is small ! Please let me know if this help/ if any additional questions. Thank you, Jayant

On Wed, Dec 4, 2019 at 6:45 PM kevinohara80 [email protected] wrote:

Can you post your Trigger body?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kevinohara80/sfdc-trigger-framework/issues/26?email_source=notifications&email_token=AB4MRP7N353J3OJEY4XMYCDQW73DTA5CNFSM4JQ6L6OKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEF6CNRI#issuecomment-561784517, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4MRP2I5UJ6Y7BGQGES4WTQW73DTANCNFSM4JQ6L6OA .

jayantsande25 avatar Dec 05 '19 11:12 jayantsande25