Jump to content

Children close parent's PG connection!


btherl

Recommended Posts

I have a script which opens a connection with pg_connect(), and then forks off several children. When the children are finished, they exit.

Unfortunately, these children inherit the parent's postgres connection, and they close this connection when they exit.

Is there any way to stop the children from closing the connection?
Link to comment
https://forums.phpfreaks.com/topic/5391-children-close-parents-pg-connection/
Share on other sites

  • 5 months later...
Thanks for the suggestion!  I solved this by using pcntl_exec(), thus avoiding php's shutdown code.

pg_pconnect() doesn't work unfortunately, as the children believe they are the only running php process.  So they shut down all persistent connections on exit.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.