AnsweredAssumed Answered

Query limit of 1000 reached for <my_module> module - issue

Question asked by Mihai Olteanu on Sep 19, 2016
Latest reply on Sep 20, 2016 by Offshore Evolution



I have a strange issue with the error in the title. I'll describe the way it occurs below:


   I have a custom action which does some calculations on the Accounts module in batches of 100 called sequentially by AJAX requests from an Administration area form. I get the Query limit of 1000 reached for <my_module> module error after about 5 or 6 Accounts were processed. It's impossible to have reached 1000 queries after just 5 Accounts, but just to be sure I changed the batch size from 100 Accounts to 2 on each AJAX request. The first 12 AJAX requests finished ok (meaning 24 Accounts were processed) but on the next one I got the same error. Afterwards, I continued with the 2 batch size and got the error again after about 50 AJAX requests. 


   The instance I'm getting this error on is hosted in OnDemand, and I never encountered it on my local dev SugarCRM instance (i didn't remove the query limit in config_override.php).

   Shouldn't each AJAX request be treated as a separate process (I understand that the query limit is per process) ? How could I fix this or at least do some debugging in the OnDemand instance ? Is there a global variable which hold the number of queries so far ?