Skip to main content

Hi everyone, 

 

Today I've taken a look and tested the Apex Cursor's Beta on a Developer Pro Sandbox (Unlimited Edition), using a Cursor on a query that returned ~345,000 records, up to a point where I'm getting the following exception message: 

Cursor Rate Limiting Exception : DailyApexCursorRowsLimit Limit exceeded.

Question is, according to the Apex Governor Limits documentation, I have a 100 million limit on cursor daily rows I can fetch, can't tell for sure but I feel like it was less for me, 100M/345k = ~288 tests 

 

Is there a way to check for this limit? I tried using the limits API endpoint (/services/data/v63.0/limits) but it's not returned, also there is no method for this in the Limits class. 

 

Second question is, (can't tell right now, will check tomorrow), but if I remember correctly, is the  Limits.getFetchCallsOnApexCursor() working as expected? the few times I checked in the debug logs it was returning 0, even after fetching 10 times on the cursor for that transaction. 

 

And lastly, reading the Apex Cursors (Beta) documentation, says that Apex cursors have the same expiration limits as API Query cursors, that is, results are available for 2 days. Say you have a LWC that calls an Apex method in the connectedCallback(). This method creates a cursor for a query and returns a set of records (cursor.fetch(0, 200); for example). 

 

Since the query results are stored for 2 days, is it really mandatory to create the cursor each time the components is loaded? How would I access records from a non-expired cursor, if possible? 

 

Thanks for reading, hope my questions make sense :) 

CC: @Daniel Ballinger

0/9000