Skip Menu |

This queue is for tickets about the DBIx-SearchBuilder CPAN distribution.

Report information
The Basics
Id: 3891
Status: resolved
Priority: 0/
Queue: DBIx-SearchBuilder

People
Owner: Nobody in particular
Requestors: autrijus [...] autrijus.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Date: Sun, 28 Sep 2003 12:21:16 +0800
From: Autrijus Tang <autrijus [...] autrijus.org>
To: Jesse Vincent <jesse [...] bestpractical.com>
Subject: [PATCH] SB::Handle::dbh should _not_ be singleton
Patch follows. It was not advertised to be a singleton, and the current behaviour breaks RTx::Report pretty hard. I'm aware that it must be made a package variable to not break Storable, so a per-object hash looks like a good idea to me. I'd be happy if you can incoporate it into the next release, so RTx::Report can have a SB version to depend on. Thanks, /Autrijus/ --- Handle.pm.orig Sun Sep 28 12:02:17 2003 +++ Handle.pm Sun Sep 28 12:18:32 2003 @@ -4,7 +4,7 @@ use DBI; use strict; use Class::ReturnValue; -use vars qw($VERSION @ISA $DBIHandle $DEBUG $TRANSDEPTH); +use vars qw($VERSION @ISA %DBIHandle $DEBUG $TRANSDEPTH); $TRANSDEPTH = 0; @@ -288,9 +288,9 @@ my $self=shift; #If we are setting the database handle, set it. - $DBIHandle = shift if (@_); + $DBIHandle{$self} = shift if (@_); - return($DBIHandle); + return($DBIHandle{$self}); } # }}} @@ -760,6 +760,7 @@ sub DESTROY { my $self = shift; $self->Disconnect if $self->{'DisconnectHandleOnDestroy'}; + delete $DBIHandle{$self}; }
Download (untitled)
application/pgp-signature 187b

Message body not shown because it is not plain text.

[autrijus@autrijus.org - Sun Sep 28 02:11:34 2003]: Show quoted text
> Patch follows. It was not advertised to be a singleton, and the > current behaviour breaks RTx::Report pretty hard. > > I'm aware that it must be made a package variable to not break > Storable, so a per-object hash looks like a good idea to me. > > I'd be happy if you can incoporate it into the next release, so > RTx::Report can have a SB version to depend on. >
How did this ever get made to be fixed, anyway? Show quoted text
> Thanks, > /Autrijus/ > > --- Handle.pm.orig Sun Sep 28 12:02:17 2003 > +++ Handle.pm Sun Sep 28 12:18:32 2003 > @@ -4,7 +4,7 @@ > use DBI; > use strict; > use Class::ReturnValue; > -use vars qw($VERSION @ISA $DBIHandle $DEBUG $TRANSDEPTH); > +use vars qw($VERSION @ISA %DBIHandle $DEBUG $TRANSDEPTH); > > $TRANSDEPTH = 0; > > @@ -288,9 +288,9 @@ > my $self=shift; > > #If we are setting the database handle, set it. > - $DBIHandle = shift if (@_); > + $DBIHandle{$self} = shift if (@_); > > - return($DBIHandle); > + return($DBIHandle{$self}); > } > > # }}} > @@ -760,6 +760,7 @@ > sub DESTROY { > my $self = shift; > $self->Disconnect if $self->{'DisconnectHandleOnDestroy'}; > + delete $DBIHandle{$self}; > } > >