cancel
Showing results for 
Search instead for 
Did you mean: 

iOS Application with Ultralite crashed with error Too many open cursors !

Former Member
0 Kudos

Hi Guys,

I am trying to fix an crash issue. On loading an tableview everything works fine but if the user is trying to scroll up and down faster the fields displayed gets removed.

Each fields are taken from the dB and displayed. As a result of fast action the values from DB returns Nil thus app crashes.. if Handling crash then it show empty fields.

Error on console:

[Main thread]Error while executing sql query:

(Too many open cursors)

SQLCODE: -1230

NSLocalizedFailureReason: Too many open cursors

NSURL: http://dcx.sybase.com/ulerr?id=-1230&version=1201⟨=en

NSLocalizedDescription: Error while executing sql query:

I can see that each statement is closed at some part in applicaiton.

I knew this looks wierd . Please put up your suggestion here.


chris_keating
Advisor
Advisor
0 Kudos

This question is being discussed on https://sqlanywhere-forum.sap.com/.

KRiedelsheimer
Community Manager
Community Manager
0 Kudos

Hi Dinesh,

if you have a UITableView and you load data out of the DB while dequeuing the cells (load data for each cell while scrolling), you have to create a cursor for each DB access. At some point the DB will complain that you have to many open cursors even if you close them at some point. With that you run into race conditions. Can't you initially load the data out of the DB asynchronously? If you have a lot of data you might want to build in a paging mechanism for you UITableView. For that you could use the datasource prefetching mechanism described here:

https://developer.apple.com/documentation/uikit/uitableviewdatasourceprefetching

I hope this helps.

Cheers,

Kevin

Accepted Solutions (0)

Answers (0)