[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

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:

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 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 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] An undefined function in a check constraint will cause selecting from sqlite_master to fail.

2013-01-07 Thread Dan Kennedy
On 01/05/2013 05:00 AM, Peter Aronson wrote: I've thought about this a bit more, and concluded this is probably a bug. If you define your own function, and reference it in a check constraint, and then try to select from sqlite_master when that function is not currently defined, the select fails

Re: [sqlite] Using SQLite on a networkshare

2013-01-07 Thread Simon Slavin
On 7 Jan 2013, at 1:16pm, Raymond Meester wrote: >1) What is the best way to use sqlite on a networkshare (shared cache > mode / unlock notify / busy timeout etc)? I saw a lot of posts about issues > with >multiple connections when the db file is on

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] (Lemon) (Patch) adding a -f option to Lemon to emit function prototypes

2013-01-07 Thread Tiago Rodrigues
Oops, Dominique alerted me to the fact that the patch I included was stripped by the listserver... I'm including it inline, then. (Begin patch) --- lemon.c2013-01-04 20:39:20 + +++ lemon-new.c2013-01-04 23:09:59 + @@ -109,7 +109,7 @@ void Reprint(struct lemon *); void

Re: [sqlite] (Lemon) (Patch) adding a -f option to Lemon to emit function prototypes

2013-01-07 Thread Richard Hipp
On Mon, Jan 7, 2013 at 4:18 PM, Tiago Rodrigues wrote: > Oops, Dominique alerted me to the fact that the patch I included was > stripped by the listserver... I'm including it inline, then. > This patch does not work in the general case. I don't doubt that it works for your

[sqlite] sqlite-users Digest, Vol 61, Issue 7

2013-01-07 Thread Walter
On 1/6/2013 7:10 PM, Walter wrote: sqlite3_prepare16_v2 (vMdb, ws.c_str (), ws.size (), , ); The third parameter of sqlite3_prepare16_v2 is the length of the string *in bytes*, not in characters. You are effectively passing only half the statement. -- Igor Tandetnik Thank you Igor and

Re: [sqlite] Using SQLite on a networkshare

2013-01-07 Thread Jean-Christophe Deschamps
Raymond, So I checked some server/client solutions from http://www.sqlite.org/cvstrac/wiki?p=SqliteNetwork. But as there wasn't a solution that supported my script language (Autoit) I ended up writing my own server/client solution. This worked for me, but I still have some questions regarding