function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NahuelNahuel 

FATAL_ERROR | System.LimitException: Too many SOQL queries across namespaces: 1101

Hi everyone,

I am hitting this error in a Unit Test on an org where I am converting multiple leads in bulk. The same Unit Test passes correctly if I only convert 1 Lead. But when I try to convert 50 at once, the test method does not pass and in the debug logs I found this error:
FATAL_ERROR | System.LimitException: Too many SOQL queries across namespaces: 1101
I have googled and searched but either noone has posted about this issue or my googlefu skills are lacking. I did find a lot of hits of a similar error of just hitting the limit, but this "across namespaces: 1101" is what's making me think this is another case.

If anyone has a clue what it could be or where I could look at, I'd appreciate it.

Thanks,
Nahuel
 
Rajiv Penagonda 12Rajiv Penagonda 12
Nahuel, details of this limit is covered in Salesforce Execution Governor Limits document here (https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_apex_governor_limits.htm).

If you look for the section "Per-Transaction Certified Managed Package Limits" you will notice this statement - "This cumulative limit is 11 times the per-namespace limit. For example, if the per-namespace limit for SOQL queries is 100, a single transaction can perform up to 1,100 SOQL queries".

It appears that in your org, the managed packages are exceeding the system limits. You could look in the debug logs to identify which (or all) of these managed packages are causing this.

Hope this helps.
-Rajiv
NahuelNahuel

Thanks for the information Rajiv.
However, there is only 1 package in this org and it's Rollup Helper, which is not causing any trouble in this specific scenario. What I did notice from profiling however, is that the Lead Trigger that is doing the Lead Convert operation, is being run 104 times when the test is run with 50 Leads. For some reason, it does not seem to be treating the operation in bulk, meaning we are doing 1 Lead Insert operation and 1 Lead Convert operation, but it seems to do a single transaction for each Lead. If that makes any sense.
Rajiv Penagonda 12Rajiv Penagonda 12
about your statement - "...we are doing 1 Lead Insert operation and 1 Lead Convert operation..." can you share your code sample here (just the part that invokes Database.convertLead)?

Database.convertLead is overloaded, one accepts one lead only, and the other accepts a list of leads to convert. Inorder for you to make bulk calls you'd have to be invoking the later. There is a good chance you already know this, but in case you missed.

-Rajiv
Rodney Farach 6Rodney Farach 6
Hi Nahuel. Did you solve the issue? I am facing the same error and I don't have any clue of how to solve the problem. Thanks!
NahuelNahuel
I'm sorry but it has been a while and I don't remember if this came to a conclusion or not.