Re: [CDBI] Close CDBI DB connection?
[prev]
[thread]
[next]
[Date index for 2005/09/29]
>> Is there a (nice or nasty) way to ask CDBI to disconnect when I'm
>> finished using the database?
yoorobot@xxxxx.xxx wrote:
> Class->db_Main->disconnect ?
Yes, thanks, that did the job!
I did search the CPAN doc for "disconnect", and even backing up the doc
hierarchy to Ima::DBI doesn't mention it -- is it a rebellious thing to do?
Stepping through the code I find myself in Ima::DBI and see this:
sub _mk_db_closure {
my ($class, @connection) = @_;
my $dbh;
return sub {
unless ($dbh && $dbh->FETCH('Active') && $dbh->ping) {
$dbh = DBI->connect_cached(@connection);
}
return $dbh;
};
}
So I'm getting a random connection from a cache (I guess?), and closing
it. Should I be shutting the cache down instead?
Anyway, thanks, for my current problem you've given me a fine solution,
Steven
_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
|
|
Re: [CDBI] Close CDBI DB connection?
Steven Mackenzie 14:51 on 29 Sep 2005
|