Forum Discussion
DataSource.Error: invalid query locator when expanding a column
All I had to do was refresh the preview of my data and the error went away.
- jvaught7 years agoAdvocate II
Here's an excerpt from https://help.salesforce.com/articleView?id=000004410&language=en_US&type=1 which sheds some light:
Each Salesforce user can have up to 10 query cursors open at a time. This is a hard coded limit that cannot be increased. If 10 query locator cursors are opened when a client application attempts to open a new one, then the oldest cursor is released. If a call is attempted to an expired or released cursor, salesforce.com will return the INVALID_QUERY_LOCATOR error. To avoid this error, ensure that the client code is not holding open more than 10 query locator cursors. If multiple processes are running using the same salesforce.com user, make sure that their combined query locator cursor count remains at 10 or below.
That's really good info and probably explains why several people are reporting solutions which seem unrelated, included the simple "I just refreshed again and it went away". Each of these "solutions" must have somehow reduced the query locator curser count below 10. Now, if we could figure out a more consistent way to do that!
I have been vexed by this off and on for about as long as this thread has been going on. This is great advice:
"To avoid this error, ensure that the client code is not holding open more than 10 query locator cursors."
But HOW do I do that? I'm not sure but will post again if I figure it out!UPDATE: the easiest way to resolve this is to step through each query and "Refresh Preview" for the queries one by one (not "Refresh all").
If this solves your issue, please mark as a solution. thanks!
- GCL7 years agoFrequent Visitor
Dear,
indeed, very interesting point.
I'll discuss this "10 query locator cursors" topic with a Salesforce expert.
I'll come back to this message as soon as I receive a relevant feedback.Thx
Best regards,
Gaston