Re: [sqlite] SQLite, pthread and daemon

2007-10-04 Thread Sabyasachi Ruj
In the source code that I posted earlier you are correct. But I tested that after changing that code a bit. I called 'sqlite3_close' just after I called 'sqlite3_open'. Then also I am not getting correct PID inside the thread. So can I do just a 'open' and 'close' of sqlite in parent process and t

Re: [sqlite] SQLite, pthread and daemon

2007-10-04 Thread John Stanton
You are not only accessing an Sqlite connection across threads, but also processes! Create the DB connection in the thread in which it is being used and you will obey the needs of all versions of Sqlite. One da6tabase may be used across processes provided that you create the connection accor

Re: [sqlite] SQLite, pthread and daemon

2007-10-04 Thread Sabyasachi Ruj
I read that. But it prohibits to use SQLite open handles across processes. It is not written that one database should not be used acoross process. I am carrying any sqlite open across processes. Before creating the daemon:- I am opening sqlite doing something closing sqlite. But then

Re: [sqlite] SQLite, pthread and daemon

2007-10-03 Thread Rich Rattanni
Just read this today, after doing some other research. Does this help any? http://www.sqlite.org/faq.html#q6 It says, in a nutshell, don't use a database across forks. On 10/3/07, John Stanton <[EMAIL PROTECTED]> wrote: > How do you know that when your process forks that you are looking at the

Re: [sqlite] SQLite, pthread and daemon

2007-10-03 Thread John Stanton
How do you know that when your process forks that you are looking at the child, not the parent? Sabyasachi Ruj wrote: Hi, I am writing an application which will continue to execute as a 'daemon' in Linux. The application is multi threaded. And once the daemon is created, it will create few thr

[sqlite] SQLite, pthread and daemon

2007-10-03 Thread Sabyasachi Ruj
Hi, I am writing an application which will continue to execute as a 'daemon' in Linux. The application is multi threaded. And once the daemon is created, it will create few threads to perform some tasks. >From here, I'll refer the 'process before creating the daemon' as 'PARENT PROCESS', and 'pro