I am getting two summaries in debug log. a small portion of one single log is given below. But i do not know the reason why it is happening?
09:31:34.009 (1009893000)|SYSTEM_METHOD_EXIT|[67]|System.debug(ANY)
09:31:34.013 (1013896000)|METHOD_ENTRY|[1]|01p900000041nyx|ProcessorControl.ProcessorControl()
09:31:34.013 (1013923000)|METHOD_EXIT|[1]|ProcessorControl
09:31:34.014 (1014139000)|SOQL_EXECUTE_BEGIN|[69]|Aggregations:0|select id, SAP_KUNNR__c from account where id = :tmpVar1
09:31:34.020 (1020479000)|SOQL_EXECUTE_END|[69]|Rows:1
09:31:34.020 (1020644000)|DML_BEGIN|[71]|Op:Update|Type:Account|Rows:1
09:31:34.098 (1098297000)|CODE_UNIT_STARTED|[EXTERNAL]|01q9000000082ou|AccountCallout on Account trigger event AfterUpdate for [0019000000s9SiY]
09:31:34.098 (1098561000)|SYSTEM_METHOD_ENTRY|[2]|LIST<Account>.iterator()
09:31:34.098 (1098767000)|SYSTEM_METHOD_EXIT|[2]|LIST<Account>.iterator()
09:31:34.098 (1098790000)|SYSTEM_METHOD_ENTRY|[2]|system.ListIterator.hasNext()
09:31:34.098 (1098807000)|SYSTEM_METHOD_EXIT|[2]|system.ListIterator.hasNext()
09:31:34.098 (1098837000)|SYSTEM_METHOD_ENTRY|[2]|system.ListIterator.hasNext()
09:31:34.098 (1098847000)|SYSTEM_METHOD_EXIT|[2]|system.ListIterator.hasNext()
09:31:34.927 (1098868000)|CUMULATIVE_LIMIT_USAGE
09:31:34.927|LIMIT_USAGE_FOR_NS|(default)|
Number of SOQL queries: 2 out of 200
Number of query rows: 2 out of 50000
Number of SOSL queries: 0 out of 20
Number of DML statements: 1 out of 150
Number of DML rows: 1 out of 10000
Number of code statements: 0 out of 1000000
Maximum CPU time: 0 out of 60000
Maximum heap size: 0 out of 12000000
Number of callouts: 1 out of 10
Number of Email Invocations: 0 out of 10
Number of fields describes: 0 out of 100
Number of record type describes: 0 out of 100
Number of child relationships describes: 0 out of 100
Number of picklist describes: 0 out of 100
Number of future calls: 0 out of 10
09:31:34.927|CUMULATIVE_LIMIT_USAGE_END
09:31:34.098 (1098935000)|CODE_UNIT_FINISHED|AccountCallout on Account trigger event AfterUpdate for [0019000000s9SiY]
09:31:34.103 (1103196000)|DML_END|[71]
09:31:34.103 (1103231000)|SYSTEM_MODE_EXIT|false
09:31:34.931 (1103258000)|CUMULATIVE_LIMIT_USAGE
09:31:34.931|LIMIT_USAGE_FOR_NS|(default)|
Number of SOQL queries: 2 out of 200
Number of query rows: 2 out of 50000
Number of SOSL queries: 0 out of 20
Number of DML statements: 1 out of 150
Number of DML rows: 1 out of 10000
Number of code statements: 0 out of 1000000
Maximum CPU time: 0 out of 60000
Maximum heap size: 0 out of 12000000
Number of callouts: 1 out of 10
Number of Email Invocations: 0 out of 10
Number of fields describes: 0 out of 100
Number of record type describes: 0 out of 100
Number of child relationships describes: 0 out of 100
Number of picklist describes: 0 out of 100
Number of future calls: 0 out of 10
09:31:34.931|CUMULATIVE_LIMIT_USAGE_END
09:31:34.103 (1103281000)|CODE_UNIT_FINISHED|SAPServices.CreateCustomer
09:31:34.103 (1103289000)|EXECUTION_FINISHED
Thanks, Baskaran
Attribution to: Bforce
Possible Suggestion/Solution #1
The debug log will contain the Cumulative resource usage (the LIMIT_USAGE_FOR_NS event identifer) when a code unit has finished. Note: it will log this information after many code units are finished (a list is contained in the recommended reading below).
My assumption based on the debug log you have posted: on the after update transaction of the Account Trigger, you are performing some code that checks to see if the trigger has been processed, and if not to perform some update on Account. This would cause the after update to fire again, but only to find that it has been processed, and continue on.
This would show as two distinct code units within the debug log, and the cumulative resource usage will be logged after each code unit finishes, since they are triggers.
Recommended Reading: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_debugging_debug_log.htm
Attribution to: Mark Masterson
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/30800