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
CustomDataIntegrationsCustomDataIntegrations 

SOQL Limit of 50000 isn't working

I have these 3 queries in the opening of my first page:

        List<Contact> lstContacts = [select id, MailingStreet, MailingCity, MailingState, MailingPostalCode, FirstName, LastName from contact LIMIT 50000];
        List<Lead> lstLeads = [select id, Street, City, State, PostalCode, FirstName, LastName from lead LIMIT 50000];
        List<Account> lstAccounts = [select id, ShippingStreet, ShippingCity, ShippingState, ShippingPostalCode from account LIMIT 50000];

I  have a user that is getting the following error when they try to open the application: Too many query rows: 50001

How is this possible if I have a limit on each of my queries?
nitin sharmanitin sharma
I think from one transaction you can query 50,000 records and it seems that you are querying more than 50,000
CustomDataIntegrationsCustomDataIntegrations
So I can't do 3 queries that each have a limit of 50000 records, it is 50000 is the limit for 1 transaction?  So for 1 trip back to the server, only a total of 50000 records for all queries can be retrieved, is that correct?
Cloud_forceCloud_force
salesforce documentation mentions it as total number of records retunred in SOQL Queries.
That means it applies to all the queries fired in one transaction.

thanks,
http://www.forcexplore.com/2014/07/wrapper-class-in-salesforce.html