> Uhm... I always thought that sharing the same socket between
> processes is wrong.
Well, I've never thought about it before this problem, but it definitely
appears to me like something not to do. Sharing remote object doesn't sound
right :-(
> My multi-process daemon works like apache with a pool of processes
> everyone with its own connection to the DB. The connection is only
> opened AFTER the fork and remains open as long as the process lives just
> to avoid a new connection for each accept.
When you can do it this way, that's nice'n'easy. In my case, I have to have a
connection before the fork, and keep it after in both parent and child,
eventhough it will be closed a few seconds later in the child. So, for now on,
the only-almost-clean-solution is to free the pgconn structure in the child
and reconnect when needed. This way, the parent process keeps its own
connexion. No other process is using it. Sounds safe, but kinda
"do-it-yourself" :-(
--
Sébastien Bonnet bonseb@free.fr http://bonseb.free.fr/