Re: [sqlite] sqlite3_step returns sqlite_busy

2010-07-07 Thread Pavel Ivanov
t;Pavel Ivanov" <paiva...@gmail.com> > To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> > Sent: Wednesday, July 07, 2010 6:40 PM > Subject: Re: [sqlite] sqlite3_step returns sqlite_busy > > >>> one thread is preparing an "INSERT&

Re: [sqlite] sqlite3_step returns sqlite_busy

2010-07-07 Thread Lloyd
So it means we can have mor than one valid db handle? Thanks, Lloyd - Original Message - From: "Pavel Ivanov" <paiva...@gmail.com> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> Sent: Wednesday, July 07, 2010 6:40 PM Subject: R

Re: [sqlite] sqlite3_step returns sqlite_busy

2010-07-07 Thread Pavel Ivanov
> 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? Sure. Preparing INSERT statement doesn't acquire any "write" locks on the database. It's executing the INSERT

[sqlite] sqlite3_step returns sqlite_busy

2010-07-07 Thread Lloyd
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