Richard, Just to go one step ahead, If there are independent connections, do you mean that there can exist multiple transactions at the same time? I think not since the first transaction (write) will exclusively lock the database and the second transaction will get a busy error. Correct me if I am wrong. Will the behaviour differ in case of shared cache enabled and disabled?
-Shailesh. > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of D. Richard Hipp > Sent: Tuesday, June 10, 2008 5:28 PM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] Database locked error, while deleting > > > On Jun 10, 2008, at 7:36 AM, Sabyasachi Ruj wrote: > > > Hi, > > > > I have a very big table with around 40,00, 000 rows. 4 columns. 220 > > MB. > > > > Now, I have two threads:- > > Thread1: Is deleting 7,00, 000 rows from the table. > > Thread2: Is doing SELECT on the same table. > > > > Now the problem is sometimes the sqlite3_prepare for the > SELECT query > > is failing with SQLITE_BUSY error. > > > > My questions: - > > 1. What is the best way to handle this error, and continue working > > normally? > > 2. Is there any documentation in sqlite3.org, which discuses the > > locking mechanism for DELETEs? Exacly in what phase of > DELETE sqlite > > creates the exclusive lock, so, the SELECT is failing? > > > > > Are the two threads using the same database connection, or > are they making separate and independent calls to sqlite3_open()? > > > D. Richard Hipp > [EMAIL PROTECTED] > > > > _______________________________________________ > 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