Re: [sqlite] database busy error

2012-07-02 Thread Kevin Martin
> If I have a pool of external (c++) progs, all writing into the same sqlit3 db,
> how do i handle this correctly ?


I think it depends on your applications.

We use sqlite for IPC and data sharing within processes on the same machine. 
I'm not suggesting it for you, but the following works for us:

o We do all our modifications within exclusive transactions (by this I mean we 
do any selects, calculations, updates, inserts which are required for the 
modification within a single exclusive transaction) 

o We work under the assumption that the db will become unblocked eventually.

o We have a few attempts to begin exclusive (5 I think) with random pauses 
between them. If we still haven't locked it after that we tell nagios of this 
fact which alerts us something is wrong then we enter an infinite loop 
attempting to get the lock.

The only time we've ever had nagios alerts was due to filesystem/SAN issues. 
Under normal working we've never had a problem. There are probably around 5 
small writes/second to the database.

Thanks,
Kev

On 2 Jul 2012, at 14:13, deltagam...@gmx.net wrote:

> Now, sometimes I get db busy error (5)
> ___
> 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


Re: [sqlite] database busy error

2012-07-02 Thread Stephan Beal
On Mon, Jul 2, 2012 at 3:13 PM, deltagam...@gmx.net wrote:

> If I have a pool of external (c++) progs, all writing into the same sqlit3
> db,
> how do i handle this correctly ?
> Now, sometimes I get db busy error (5)
>

See: http://sqlite.org/lockingv3.html

Search for SQLITE_BUSY to see what can cause that. Other docs (which i
can't seem to find at the moment) explain how to deal with BUSY in your app.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] database busy error

2012-07-02 Thread deltagam...@gmx.net
If I have a pool of external (c++) progs, all writing into the same 
sqlit3 db,

how do i handle this correctly ?
Now, sometimes I get db busy error (5)
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users