tags:

views:

43

answers:

2

Hi everyone,

I have a last probleme before finishing my application. I use SQLITE DataBase. Everything works perfectly on the simulator, but when i run the app on my Iphone with Dev provisionning profile, i got an error on the sql methods :

I have a method that executes the following code :

if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK)

Unfortunately, this line send SLITE_BUSY.

But the weird thing is that if I execute another method with the same SQLITE part, it works. only this specific method crashes.

I don't think it is the lock on the database that is the problem, but i'm going crazy trying to figure it out !

Please help !!

+1  A: 

Is it a multi-threaded application? Is it possible that SQLite really is busy with another operation? Also, did you try setting a busy timeout with sqlite3_busy_timeout?

MPelletier
No, not a multi-threaded application. And i don't think that sql is busy with another application because instead of calling the bugged method, i can call other methods that use SQLITE and work properly.I'll try sqlite_busy_timeout, thanks
Clem
Sqlite_busy_timeout doesn't helps .... always BUSY.How is it possible that on the simulator it works perfectly and not on the iphone ?
Clem
SQLite saying it's busy means that another operation is running on the same database. Check the operations used just before.
MPelletier
+1  A: 

It wasn't a SQLite problem, i was right when i said that it wasn'it possible that the DB was locked.

I juste restarted my iMac and the iPhone and all is allright now.

Thanks everyone !!

Clem
I'll be damned. Congrats!
MPelletier