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.



The app works but, is anyone working with sqlite this way? Any advice
to avoid db corrupts, deadlocks, whatever? Please, don't talk about
changing to multithread model, i don't want to use them for this
project.


Thanks

---   --- Eduardo Morras<emorr...@yahoo.es>
_______________________________________________ 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

Reply via email to