Re: preloading modules and apache::dbi

2012-01-19 Thread Perrin Harkins
On Thu, Jan 19, 2012 at 8:48 AM, Josh Narins wrote: > The idea of Apache::DBI is that you get to pool connections. > > If you call Apache::DBI->new and there is a spare connection, you get it, if > not, one is created for you. That's a little misleading. There's no actual pooling. Connections

Re: preloading modules and apache::dbi

2012-01-19 Thread mike cardeiro
> From: Perrin Harkins > However, if you are trying to make the handle persistent >yourself, by putting it in a global variable or something similar, >that will be a problem.  You have to close all connections you open >during startup, and open new ones in the child processes. > heres kinda s

Re: preloading modules and apache::dbi

2012-01-19 Thread Michael Peters
On 01/19/2012 08:48 AM, Josh Narins wrote: The idea of Apache::DBI is that you get to pool connections. If you call Apache::DBI->new and there is a spare connection, you get it, if not, one is created for you. This isn't quite accurate. Apache::DBI doesn't do connection pooling, it manages pe

RE: preloading modules and apache::dbi

2012-01-19 Thread Josh Narins
The idea of Apache::DBI is that you get to pool connections. If you call Apache::DBI->new and there is a spare connection, you get it, if not, one is created for you. You almost certainly don't want one $db object being shared as a member of a class, unless your entire program also happens to r

Re: preloading modules and apache::dbi

2012-01-19 Thread Perrin Harkins
On Wed, Jan 18, 2012 at 5:08 PM, mike cardeiro wrote: > I have a library I want to preload.  This library makes a database > connection and assigns it to a variable that is exported so all programs can > use this handle. > > will this global handle db handle be a single handle amongst all apache >

Re: preloading modules and apache::dbi

2012-01-18 Thread Brett Lee
Hi Mike, I believe the answer is that each http process will have its own handle.  At least that's what it appears to be when I view the handles via http://hostname/perl-status. Hope you enjoy mod_perl.   Best regards, - - Brett Lee Encrypt your data with PDS - http://crypto.brettlee.com/ >_