johnnywang has asked for the wisdom of the Perl Monks concerning the following question:
The other scripts simply call get_connection whenever they need a connection. Since the call is to connect_cached, I'm not closing the connection in other scripts. This seems to be working fine. But, some of the scripts are deployed into mod_perl with Apache::DBI pre-loaded, which provides connection caching. Furthermore, I'm also using Class::DBI in some other scripts, which I understand also uses its own connection caching. All of these work on the surface, but I'm not sure whether caching is actually taking place, and which module is doing the caching, and whether there is any potential conflicts here. Thanks.sub get_connection{ return DBI->connect_cached($dbUrl, $dbUser, $dbPassword, { RaiseError => 0, PrintError=>1,AutoCommit => 1}) or warn("Failed to connect to DB"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI::connect_cached, Apache::DBI and Class::DBI
by perrin (Chancellor) on Nov 30, 2004 at 04:10 UTC | |
by Arunbear (Prior) on Nov 30, 2004 at 09:00 UTC | |
by perrin (Chancellor) on Nov 30, 2004 at 15:45 UTC | |
|
Re: DBI::connect_cached, Apache::DBI and Class::DBI
by etcshadow (Priest) on Nov 30, 2004 at 01:59 UTC |