RE: Does an explicit database close method exist?
[prev]
[thread]
[next]
[Date index for 2004/09/20]
=20
=20
> Class::DBI->set_db( 'Main', "dbi:Oracle:$db" );
[snip]
> # Return all database handles
> @dbh =3D SOME_DBI_CLASS->db_handles;
>=20
> # I only have interest in first because I only have one DB connection.
> $dbh =3D $dbh[0];
>=20
> $dbh->disconnect;
If you know you're only ever going to have one DB connection, you should =
be able to access it through name - which is probably better:
__PACKAGE__->db_Main->disconnect;
Alternatively loop through all and nuke them from orbit:
foreach my $dbh (__PACKAGE__->db_handles) {
$dbh->disconnect;
}
only way to be sure :-)
Carl =20
--------------------------------------------------------
GMG Regional Digital is part of the Guardian Media Group plc.=20
=20
=20
=20
=20
CONFIDENTIALITY NOTICE. The information contained in this e-mail is =
intended only for rrom@xxx.xxxxxxxxx.xxx, cdbi-talk@xxxxxx.xxxxx.xxx. It =
may contain privileged and confidential information that is exempt from =
disclosure by law and if you are not an intended recipient, you must not =
copy, distribute or take any action in reliance on it. If you have =
received this e-mail in error, you may notify us by telephone on 44 =
(0)161 832 7200. E-mail transmission cannot be guaranteed to be secure =
or error-free. The sender (carl.johnstone@xxxxx.xx.xx) therefore does =
not accept liability for any errors or omissions in the contents of this =
message, which arise as a result of e-mail transmission. If verification =
is required please request a hard-copy version. =20
=20
=20
=20
=20
=20
=20
|
|
RE: Does an explicit database close method exist?
Carl Johnstone 14:45 on 20 Sep 2004
|