On Mon, 07 Jan 2013 20:09:02 +0700 Dan Kennedy <danielk1...@gmail.com> 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 etc, opened before the fork, and after it > > the childs use the database connection. I don't want to corrupt the > > database, but the documentation only talks about the use with > > threads. I use a version compiled with -DSQLITE_THREADSAFE=1 and > > shared_cache mode on setted by parent before open db. > > I'm not sure I follow this exactly. > > You don't want to open a connection in the parent, call fork, > then continue to use the same connection in the child process. > That will lead to problems. > > On the other hand, if you are calling fork(), then exec() from > within the child process, then opening a new connection to the > same db, that's fine. I'm still thinking about it, because now (5 minutes since last reply to thread), i want to used shared cache but it will not work (ref from http://www.sqlite.org/sharedcache.html) so each child will have it's own shared cache for its threads/subchilds and not a global cache shared with parent and all childs. --- --- Eduardo Morras <emorr...@yahoo.es> _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users