On Wed, 2 Feb 2000, Oleg Bartunov wrote:

> On Wed, 2 Feb 2000, Stas Bekman wrote:
> 
> > Date: Wed, 2 Feb 2000 20:21:20 +0200 (IST)
> > From: Stas Bekman <[EMAIL PROTECTED]>
> > To: Pascal Eeftinck <[EMAIL PROTECTED]>
> > Cc: mod_perl list <[EMAIL PROTECTED]>
> > Subject: Re: Using network appliance Filer with modperl
> > # DESTROY makes all kinds of cleanups if the fuctions were interuppted
> > # before their completion and haven't had a chance to make a clean up.
> > ###########
> > sub DESTROY{
> >   my $self = shift;
> > 
> >   $self->sql_unlock_tables() if defined $self->{lock};
> > 
> >   $self->{sth}->finish     if defined $self->{sth} and $self->{sth};
> >   $self->{dbh}->disconnect if defined $self->{dbh} and $self->{dbh};
> > 
> > } # end of sub DESTROY
> 
> Stas, are you sure DESTROY executed when children died ?
> I'm using ApacheDBI and have problem with DESTROY when I use
> finish or disconnect methods.

Of course! This works for me:
die.pl
--------
use MyRun;
print "Content-type: text/plain\n\n";
print "hi\n";
my $obj = new MyRun;
die "dying...";
print "End of program\n";

MyRun.pm
--------
package MyRun;
sub new{  return bless {}, shift;}
DESTROY{ print STDERR "destructor was called\n";}
1;

The disconnect method shouldn't work as it gets overriden by Apache::DBI
with NOP. However finish() is supposed to work.

_______________________________________________________________________
Stas Bekman    mailto:[EMAIL PROTECTED]      http://www.stason.org/stas
Perl,CGI,Apache,Linux,Web,Java,PC     http://www.stason.org/stas/TULARC
perl.apache.org    modperl.sourcegarden.org   perlmonth.com    perl.org
single o-> + single o-+ = singlesheaven    http://www.singlesheaven.com

Reply via email to