Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Posts: 587
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA

Concurrent Database Access

My understanding is that to do concurrent database access, one should read up on:






Unfortunately, reading these docs still leaves it very unclear in my mind how to use the classes.


For example:


1.  In the SqlConnection code example, why does the code both setup a signal/slot connection to have onLoadResultData function called, and yet it also calls that function explicitly. Won't it then get called twice?


2.  In SqlConnection, there is mention made that because of limitations of Sqlite, it's best to have a single SqlConnection per app.  But if you have a single instance, and that instance is connected to a function that gets called upon each result, then a single function will be getting called regardless of what query you make on the database. There's no way that would work. How would the handler function know which query response it was dealing with?


3. It's not clear to me why you'd create a worker and then pass that in to SqlConnection. Is that only if you want to subclass SqlWoker?


4. If you have an existing app with a bunch of standard uses of SqlDataAccess in the main thread, can you use SqlConnection in other threads and have them cooperate, or do you have to retrofit the entire app and replace every use of SqlDataAccess with SqlConnection?