[cgiapp] Lazy DBI

Joshua Miller unrtst at gmail.com
Thu Feb 14 06:27:51 EST 2008


Just my 2cents... Apache::DBI. Entirely forget about passing it around..
that's too much work. Create an ini file or something, and put your
connection options in there, maybe even your own lib to connect to various
db's, but call the connect from various libs whenever needed, and let
Apache::DBI handle caching the connections. Apache::DBI is simply a more
elegant solution... only problem is that it assumes you're running apache
(not an problem for me).

On Thu, Feb 14, 2008 at 5:59 AM, Mark Knoop <mark at rawcane.net> wrote:

> Hi
>
> Still getting up to speed on CGI::Application while redeveloping my app
> along with your valuable help.
>
> I am looking at the DBI plugin and would like to benefit from the lazy
> loading idea.
>
> The thing is the actual database calls will be made from other objects.
>
> So I can put dbh_config in cgiapp_init but then how do I best get the dbh
> when I need it?
>
> I have been considering the various param options with your help via
> another
> thread and am still considering my options but however I do that I don't
> really want to be passing the CGI::Application into every new object just
> so
> I can get to the dbh.
>
> But (I may be wrong) if I create a dbh ref to pass around then I create a
> connection and so lose out on the lazy loading.
>
> Any advice on the best approach to this?
>
> Thanks
> Mark
>
>
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################
>
>


More information about the cgiapp mailing list