perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Batara Kesuma <>
Subject Re: Closing DB handler with PerlCleanupHandler
Date Wed, 10 Nov 2004 03:51:56 GMT
Hi Stas,

> 1) use Apache::DBI
> 2) if not, refer to:

Thank you for the answer. I tried to use Apache::DBI with
dbi_connect_method => 'connect'. But I have a problem here, because I
use 'our' on $dbh so other functions can use it. It looks like:

sub show_name {
  our $dbh;
  my $sth = $dbh->prepare("SELECT name FROM member WHERE id=?");

my $mn = MyPackage::Main::->new();
our $dbh = $mn->load_dbh();

So even if I use dbi_connect_method => 'connect', the connection to the
DB will be alive until the child die. I want to make the connection not
persistent. The only way I know now is to unload Apache::DBI, then call
$dbh->disconnect() at the end of every scripts. Is there any other more
efficient way to do this with little change to the scripts themselves?

Report problems:
Mail list info:
List etiquette:

View raw message