"Bradley M. Handy" wrote:
>
> In Java there is the ability to do database connection pooling, where you
> have a ConnectionPool object that contains multiple database connection in
> it. When you need a connection to a database, you get one from the pool and
> go.
>
> Is there a way to do this in Perl, or is there some article I could read to
> learn how to do this.
i'm not sure if it's the same idea, but mod_perl has a way to overload
DBI->connect(), so the connection is prevented from closing down.
the module is Apache::DBI. to use it, put something like this in your
startup.pl file:
use Apache::DBI ();
use DBI ();
use DBD::Pg (); # or whatever
# $Apache::DBI::DEBUG = 2; # uncomment to put connects in error log
Apache::DBI->connect_on_init(... dbi connect args ...);
this will make calls to DBI->connect() very fast and cheap.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]