1

If you're sitting on a Visualforce page and doing various methods that execute SOQL queries in the controller, does the query count accumulate across all the methods towards the limit until you leave the page? Or is each method invocation considered its own request with its own limit? I'm concerned about number of queries only, not the quantity of records returned.

Thanks David

1 Answer 1

5

Governor limits are transaction based.

If you click a button, and it executes 5 different methods, those 5 methods are all apart of the same transaction so the query count for that transaction with be the number of queries in those 5 methods and any related triggers.

User clicks button again, its a new transaction and the count starts from zero.

1
  • Also maybe worth mentioning that the page load (ie the controller constructor is called) is also considered a separate 'transaction'. So loading the page has 1 set of gov limits; any button execution from the page after it's loaded is a separate trans with sep gov limits.
    – Stephen B
    Commented Aug 8, 2013 at 5:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .