Re: [sqlite] Using sqlite in multi fork() without threads

2013-01-08 Thread Eduardo Morras
On Mon, 07 Jan 2013 20:09:02 +0700 Dan Kennedy wrote: > On 01/07/2013 03:22 PM, Eduardo Morras wrote: > > > > Hi, I use sqlite in some of my projects. In one it follows a > > parent/multichild model (multifork). The database is managed by the > > parent, open close backups

Re: [sqlite] Using sqlite in multi fork() without threads

2013-01-08 Thread Eduardo Morras
On Mon, 7 Jan 2013 11:11:01 +0100 Pavlos Christoforou wrote: > Hello Eduardo, > > We do (succesfully) use sqlite in a similar manner as you describe in your > post but the code ensures the DB is opened in each individual child process > *after* a child is successfully forked.

Re: [sqlite] Using sqlite in multi fork() without threads

2013-01-08 Thread Eduardo Morras
On Mon, 7 Jan 2013 12:27:54 + Simon Slavin wrote: > > On 7 Jan 2013, at 8:22am, Eduardo Morras wrote: > > > The app works but, is anyone working with sqlite this way? Any advice to > > avoid db corrupts, deadlocks, whatever? > > Read this page: >

Re: [sqlite] Using sqlite in multi fork() without threads

2013-01-08 Thread Eduardo Morras
On Mon, 07 Jan 2013 05:43:50 -0800 Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 07/01/13 00:22, Eduardo Morras wrote: > > opened before the fork, and after it the childs use the database > connection. I don't want to corrupt the database, >

Re: [sqlite] Using sqlite in multi fork() without threads

2013-01-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/01/13 00:22, Eduardo Morras wrote: > opened before the fork, and after it the childs use the database connection. I don't want to corrupt the database, https://sqlite.org/faq.html#q6 You can't use the database across forks. Parent and child

Re: [sqlite] Using sqlite in multi fork() without threads

2013-01-07 Thread Krzysztof
Few days ago I posted questions about sqlite multi threading on sqlite mailing list. I could paste link to this thread but it is for members only. So here is content, maybe it wil help you in some cases: Hi, I'm reading documentation about multi threading. I just want to be sure: 1. I can

Re: [sqlite] Using sqlite in multi fork() without threads

2013-01-07 Thread Dan Kennedy
On 01/07/2013 03:22 PM, Eduardo Morras wrote: Hi, I use sqlite in some of my projects. In one it follows a parent/multichild model (multifork). The database is managed by the parent, open close backups etc, opened before the fork, and after it the childs use the database connection. I don't

Re: [sqlite] Using sqlite in multi fork() without threads

2013-01-07 Thread Pavlos Christoforou
Hello Eduardo, We do (succesfully) use sqlite in a similar manner as you describe in your post but the code ensures the DB is opened in each individual child process *after* a child is successfully forked. It is not a good idea to carry open database connection across the fork (or any other open

Re: [sqlite] Using sqlite in multi fork() without threads

2013-01-07 Thread Simon Slavin
On 7 Jan 2013, at 8:22am, Eduardo Morras wrote: > The app works but, is anyone working with sqlite this way? Any advice to > avoid db corrupts, deadlocks, whatever? Read this page: and the parts of this page which mention threads:

[sqlite] Using sqlite in multi fork() without threads

2013-01-07 Thread Eduardo Morras
Hi, I use sqlite in some of my projects. In one it follows a parent/multichild model (multifork). The database is managed by the parent, open close backups etc, opened before the fork, and after it the childs use the database connection. I don't want to corrupt the database, but the