Skip Menu |

This queue is for tickets about the Class-DBI-FormBuilder CPAN distribution.

Report information
The Basics
Id: 16442
Status: resolved
Priority: 0/
Queue: Class-DBI-FormBuilder

People
Owner: Nobody in particular
Requestors: Brendan [...] gnarst.net
Cc:
AdminCc:

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



Subject: instance of Class::DBI::FormBuilder::Meta::Table not stored in $Instances
Hi, PERL: This is perl, v5.8.6 built for i386-freebsd-64int OS: FreeBSD banzai.gnarst.net 4.11-STABLE FreeBSD 4.11-STABLE Distribution: Class-DBI-FormBuilder-0.48 An instance of Class::DBI::FormBuilder::Meta::Table is not storing $self in $Instances So the (in postgress) very expensive operation $DBI::PG->column_info is called each time Class::DBI::FormBuilder::Meta::Table->instance is called. I've inlcuded a patch which speeds up form generation on PostgreSQL about 20 times. The patch stores $self at the end of instance. And make Singleton work at line 66 : return $Instances{$cdbi_class} if $Instances{$cdbi_class}; Thanks for lots of saving programming hours building forms! With best regards, Brendan Bank
=================================================================== RCS file: FormBuilder/Meta/Table.pm,v retrieving revision 1.1 diff -C4 -r1.1 FormBuilder/Meta/Table.pm *** FormBuilder/Meta/Table.pm 2005/12/12 13:04:10 1.1 --- FormBuilder/Meta/Table.pm 2005/12/12 13:24:30 *************** *** 77,84 **** --- 77,86 ---- $self->schema( $args{schema} || undef ); $self->_load_meta; + + $Instances{$cdbi_class} = $self; return $self; } }
Date: Mon, 12 Dec 2005 23:32:19 +0000
From: David Baird <dave [...] zerofive.co.uk>
To: bug-Class-DBI-FormBuilder [...] rt.cpan.org
Subject: Re: [cpan #16442] instance of Class::DBI::FormBuilder::Meta::Table not stored in $Instances
RT-Send-Cc:
On 12/12/05, Guest via RT <bug-Class-DBI-FormBuilder@rt.cpan.org> wrote: Show quoted text
> > This message about Class-DBI-FormBuilder was sent to you by guest <> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=16442 > > > Hi, > > PERL: This is perl, v5.8.6 built for i386-freebsd-64int > OS: FreeBSD banzai.gnarst.net 4.11-STABLE FreeBSD 4.11-STABLE > Distribution: Class-DBI-FormBuilder-0.48 > > An instance of Class::DBI::FormBuilder::Meta::Table is not storing $self in $Instances > > So the (in postgress) very expensive operation $DBI::PG->column_info is called each time Class::DBI::FormBuilder::Meta::Table->instance is called. I've inlcuded a patch which speeds up form generation on PostgreSQL about 20 times. > > The patch stores $self at the end of instance. And make Singleton work at line 66 : > > return $Instances{$cdbi_class} if $Instances{$cdbi_class}; > > Thanks for lots of saving programming hours building forms! > > With best regards, > > Brendan Bank >
Ahah! Nice catch, I knew there was something wrong with that method, what a silly mistake. Thanks, I'll upload a new version. Cheers, d.
[guest - Mon Dec 12 08:39:06 2005]: Show quoted text
> Hi, > > PERL: This is perl, v5.8.6 built for i386-freebsd-64int > OS: FreeBSD banzai.gnarst.net 4.11-STABLE FreeBSD 4.11-STABLE > Distribution: Class-DBI-FormBuilder-0.48 > > An instance of Class::DBI::FormBuilder::Meta::Table is not storing > $self in $Instances > > So the (in postgress) very expensive operation $DBI::PG->column_info > is called each time Class::DBI::FormBuilder::Meta::Table->instance > is called. I've inlcuded a patch which speeds up form generation on > PostgreSQL about 20 times. > > The patch stores $self at the end of instance. And make Singleton work > at line 66 : > > return $Instances{$cdbi_class} if $Instances{$cdbi_class}; > > Thanks for lots of saving programming hours building forms! > > With best regards, > > Brendan Bank > >
Fixed in 0.481