Welcome!

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

Java Development

Reply
New Member
Posts: 1
Registered: ‎04-20-2011
My Device: Torch

Re: Blackberry thread hanging on SQLite statement prepare

Hi, 

 

This solved for me

 

first you need to be running sqlite code on a thread , inside where you are going to use the db code.

 

 

 synchronized (UiApplication.getEventLock()) {
     Statement st = db.createStatement("SELECT NOME FROM Table");
     st.prepare();
     ...
 }

 

Bests

 

 

 

Regular Contributor
Posts: 53
Registered: ‎08-27-2013
My Device: none

Re: Blackberry thread hanging on SQLite statement prepare

I just had the same problem and it seems that the first select statements were about to be prepared before the database was created properly (the file was there, but the create statements for tables hadnt been processed yet), so I copied a working database file from a real device and the app is working fine now in the simulator. Maybe this can be of help if someone encounters this issue again.