[Catalyst-dev] Bug in Catalyst::Model::DBI .15

Evan Carroll lists at evancarroll.com
Sun May 6 23:23:59 GMT 2007


On 5/6/07, Alex Pavlovic <alex at taskforce-1.com> wrote:
> Please note that each model will still create single initial connection ( when
> request for $dbh arrives ). This happens with either approach ( squirreling
> away a connection in "new" or ref to undef scalar ).

Thanks for the patch. That should work (haven't seen it yet) because
all of my functions go through a proxy of sort anyway, M::DBI::Root.

> However re-connect will not be made afterwards for each new request. This is
> where the C::M::Proxy has advantage because single connection is created and
> maintained for all models. I would strongly recommend that you use it, rather
> then mucking around with ACCEPT_CONTEXT.
>

Could you please clairfy what Model::Proxy has to do with
ACCEPT_CONTEXT, and acccessing things like $c->user. I'm just
confused: I don't understand that. Or whatever  advantages
Model::Proxy has over just inheriting from a single model, which is
what I currently do.

If M::DBI::TableA, inherits from M::DBI::Root, which has a sub dbh {
$c->model('DBI')->dbh ) then isn't this the same end result. As in all
operations are executed through $c->model('DBI')->dbh?

I look forward to having the new M::DBI hit cpan.

-- 
Evan Carroll
System Lord of the Internets
me at evancarroll.com
832-445-8877



More information about the Catalyst-dev mailing list