On Fri, 13 Aug 2004 13:37:55 -0700, Stas Bekman wrote:
> Perrin Harkins wrote:
> > I would like to replace Apache::DBI with something oriented
> > towards connection management rather than porting old CGI scripts.  I
> > don't like the disabling of disconnect.  The old Apache::DBI could stick
> > around just for that purpose.
> 
> IMHO, that should be folded into DBI::Pool, whose prototype was written
> about 2 years ago. I wasn't able to work on it since then. It's possible
> that Tim Bunce will work on it, or may be someone else, or me once mp2 is
> released.

I like the fact that both connect() and disconnect() are overridden.  Of
course, a proper server-wide DBI connection pool would be nice, but I
wouldn't want to give up the ability to have the same code "magically" get
its connection from the pool by calling connect() and return it to the pool
by calling disconnect() when running in a certain context.

Yeah, Yet Another DBI Wrapper could do that for me too, but I don't think
the semantics described above are too crazy.  Maybe just modify DBI and add
"smart" methods named retain() and release() that call connect() and
disconnect() when offline, but do the right thing when connection pooling is
in effect?  Hrm, something tells me Tim wouldn't go for that :)

Anyway, especially in a future server-wide connection pooling context, some
sort of method of returning connections to the pool prior to the end of the
request cycle is very useful.  Why hog it if you don't need it?  Calling
disconnect() is as good a signal as any the the connection is up for grabs
again.

-John



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to