Mike Meyer wrote at 2008-1-11 11:35 -0500: > ... existing connection in forked children ... >So the question is - what should the child do to get a database >connection? Can it just keep using the existing db & cu variables?
This is very unlikely. I have had severe problems with different systems (ZODB connections, LDAP connections). Not with Oracle connections, but probably only because I do not use Oracle. When the child is forked, it inherits the connections from the parent -- but the protocols usually do not expect that several processes (parent and child) are using them asynchronously. In a single process, locks are often used to synchronize access to a shared connection from different processes -- but normal locks do not work across different processes -- and shared memory semaphores are not that often used. >If >not, does it need to do anything special, or avoid doing anything, in >order to not disrupt the parent processes use of those variables? Open a new connection in your forked child. It is not garanteed that this is sufficient. For the ZODB, I have to take additional precautions. I finally abondoned this approach completely (because, LDAP was used deeply in my system and I had no control over the creation of new connections) and am now using "fork+exec". -- Viele Grüße Dieter Tel: 06881-7327 (Festnetz) oder 06881-5590036 (Internet) _______________________________________________ DB-SIG maillist - DB-SIG@python.org http://mail.python.org/mailman/listinfo/db-sig