in reply to Re: DBI-disconnect ???
in thread DBI-disconnect ???
package class_X; require DBI; @ISA = qw( DBI ); sub new { my( $class, $dns, $username, $password ) = @_; my %attr = ( PrintError => 1, RaiseError => 0, AutoCommit => 1 ); my $self = DBI->connect( $dns, $username, $password, \%attr ) or +return; push @ISA, ref $self if( not grep { $_ eq ref $self } @ISA ); return bless $self, $class; } sub DESTROY { my( $self ) = @_; $self->disconnect; } 1; package class_Y; require class_X; @ISA = qw( class_X ); sub new { my( $class ) = @_; my $dns = "DBI:mysql:database=XXX"; my $user = "XXX"; my $pwd = "XXX"; my $self = class_X->new( $dns, $user, $pwd ); return bless $self, $class; } sub DESTROY { my( $self ) = @_; $self->disconnect; } 1;
This used to work fine (before upgrading DBI); now I'm having the same problem as mentioned in the links you (so graciously) forwarded.
I haven't yet been able to wrap my brain around the problem and figure out exactly how to solve it... Any friendly nudges in the right direction?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: DBI-disconnect ???
by mattr (Curate) on Aug 14, 2001 at 16:28 UTC | |
by christopherbarsuk (Acolyte) on Aug 14, 2001 at 18:31 UTC |