[cgiapp] Re: Combining DBIx::Simple and CGI::Session

Ron Savage ron at savage.net.au
Wed Oct 1 22:45:58 EDT 2008


Hi Mark

On Wed, 2008-10-01 at 22:05 -0400, Mark Stosberg wrote:
> > > The docs for DBIx::Simple cleary warn about using the dbh() method to
> > > get the db handle for use outside DBIx::Simple.
> > > 
> > > And yet, with CGI::Session, if I pass in a handle (returned from
> > > DBIx::Simple or otherwise), I know CGI::Session will be doing queries
> > > whenever it feels like it.
> > > 
> > > So, what to people do?
> > > 
> > > Use 2 handles, 1 via DBIx::Simple for all normal queries, and 1 via DBI
> > > just for use with CGI::Session?
> > 
> > Actually, another possibility is to use 2 DBIx::Simple-based handles,
> > one for all normal queries, and one to pass to CGI::Session but not ever
> > use via DBIx::Simple.
> 
> I asked the author about this. I think it's not that the dual-life
> handle causes problems inherinently, it's more of a "know what you are
> doing" situation. If I recall the specific issue, DBIx::Simple does it's
> own garbage collection, and you are encouraged to not mess that up,
> which shouldn't be too hard.
> 
> > Recommendations?
> 
> My recommendation is to share the handle between DBIx::Simple and
> CGI::Simple and test that your application doesn't blow up.

OK. Thanx for checking.

-- 
Ron Savage
ron at savage.net.au
http://savage.net.au/index.html




More information about the cgiapp mailing list