[CDBI] Re: Class::DBI and forking

Carlos Vicente cvicente at network-services.uoregon.edu
Fri Jan 19 22:23:06 GMT 2007


> The message it refers to is here:
> http://lists.digitalcraftsmen.net/pipermail/classdbi/2005-October/000338.html
> 
> If you use this patch to Ima::DBI, you will not need to modify anything 
> else in Class::DBI.  Make sure you set InactiveDestroy on your database 
> handles in the child process, and on any you open prior to the initial 
> fork, since those eventually time out and close as well.
> 
> - Perrin

Hi Perrin, one more question abou this.

What if I didn't want the child to open a new connection?
In my particular case, I fork children to do some SNMP queries and pass
back the results to the parent process via unix sockets.  All the DB
updates are done later in the parent process, when all children have
finished.
The way the patch works now, each child has to open a new db connection,
which ends up being unnecessary.  Right?

Is there any way I could have the option of reconnecting or not,
depending on the case?

Thanks again.

cv



More information about the ClassDBI mailing list