Of course it's possible -- multiple clients accesing the database is just fine.
 
Is there any reason you need exclusive access for each thread in ping-pong 
mode?  If not, just handle the BUSY in both places.
 
 
Michael D. Black
Senior Scientist
Northrop Grumman Mission Systems
 

________________________________

From: sqlite-users-boun...@sqlite.org on behalf of Lloyd
Sent: Wed 7/7/2010 6:56 AM
To: sqlite-users@sqlite.org
Subject: EXTERNAL:[sqlite] sqlite3_step returns sqlite_busy



Hi,

We have a multi-threaded application (I know "threads are evil", but this is a 
small server application). Each thread tries to access the SQLite database. 
When trying to get a DB handle (sqlite3_open), if it returns SQLITE_BUSY, then 
the thread will wait for some time and try to open it again (until it gets the 
handle). In our case, two threads are running, one thread is preparing an 
"INSERT" statement (It returns SQLITE_OK), then it is executed using 
sqlite3_step. sqlite3_step returns an SQLITE_BUSY! Is there any possibility for 
this? ( I think these two threads are obtaining the DB handle at the same time 
using sqlite_open - with wrtie permission- is it possible?) I have tried 
compiling the application with both  -DSQLITE_THREADSAFE=2 and 
-DSQLITE_THREADSAFE=1.

Any hint would be very helpful...

Thanks a lot,
  Lloyd

______________________________________
Scanned and protected by Email scanner
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to