Thanks I think that may be the problem. So one can share one open raw database connection across multiple threads can you?
I had (wrongly) assumed that one had to open one such connection for each thread Many thanks Paul Clarke Project LastMile IT Location: Level B offices, Hatfield CFC Direct line: 01707 228023 Mobile Work: 07951 180240 Mobile Home: 07767 313141 Internal extension: 8023 www.ocado.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of D. Richard Hipp Sent: 03 November 2008 22:46 To: General Discussion of SQLite Database Subject: Re: [sqlite] Sqlite concurrency problem On Nov 3, 2008, at 8:04 AM, Paul Clarke wrote: > Is it really correct that in order to perform an INSERT, Sqlite > demands > that no other connections be active? > > It uses the same database instance but (obviously) separate statements > for each operation > Please distinguish between a "connection" and a "statement". A "connection" is what you get back from sqlite3_open(). A "statement" is what you get back from sqlite3_prepare_v2(). You can INSERT while a query is pending on the same connection. You cannot INSERT while a query is pending on the same database file but using a different connection. Within a single program there is rarely a need to have multiple connections so this is seldom an issue. > > > When the insert is attempted, SQLITE_BUSY is returned > > > > Waiting is obviously no use because the conflicting operation is in > the > outer loop > > > > Is this expected or am I doing something silly? > > > > Thanks > > > > Paul Clarke > > > ********************************************************************* > > Notice: This email is confidential and may contain copyright > material of Ocado Limited (the "Company"). Opinions and views > expressed in this message may not necessarily reflect the opinions > and views of the Company. > If you are not the intended recipient, please notify us immediately > and delete all copies of this message. Please note that it is your > responsibility to scan this message for viruses. > Please do not print this email unless necessary. > > ********************************************************************* > > > Ocado Limited > > Titan Court > 3 Bishops Square > Hatfield Business Park > Hatfield > Herts > AL10 9NE > Tel: +44 (0) 1707 228000 > Fax: +44 (0) 1707 227999 > www.ocado.com > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users D. Richard Hipp [EMAIL PROTECTED] _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _____________________________________________________________________ This message has been checked for all known viruses by the MessageLabs Virus Control Centre. ********************************************************************* Notice: This email is confidential and may contain copyright material of Ocado Limited (the "Company"). Opinions and views expressed in this message may not necessarily reflect the opinions and views of the Company. If you are not the intended recipient, please notify us immediately and delete all copies of this message. Please note that it is your responsibility to scan this message for viruses. Please do not print this email unless necessary. ********************************************************************* Ocado Limited Titan Court 3 Bishops Square Hatfield Business Park Hatfield Herts AL10 9NE Tel: +44 (0) 1707 228000 Fax: +44 (0) 1707 227999 www.ocado.com _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users