[mod_python] connection pool (OT)

Nicolas Lehuen nicolas.lehuen at gmail.com
Thu Dec 15 03:27:38 EST 2005


It looks like the mod_dbd API is just the Apache's wrapping side to
the APR DB API :

http://people.apache.org/~niq/dbd.html

Now, that's about all the available documentation about this subject,
so I guess we'll have to wait a long time before it is usable...

Regards,
Nicolas

2005/12/15, David Fraser <davidf at sjsoft.com>:
> Hi Nicolas
>
> I saw this too but it seems incredibly sparing in terms of the API...
> How do you get it to run the actual SQL commands?
>
> David
>
> Nicolas Lehuen wrote:
> > Note that Apache 2.2  features a database API with connection pooling
> > capabilities. This is all very brand new and bug-prone, but we could
> > imagine building a DBAPI wrapper around this API, thus making it
> > possible to rely on Apache-level pooling mechanisms. See :
> >
> > http://httpd.apache.org/docs/2.1/mod/mod_dbd.html
> >
> > Anyway, this is not a solution in the short term.
> >
> > Regards,
> > Nicolas
> >
> > 2005/12/14, Graham Dumpleton <grahamd at dscpl.com.au>:
> >
> >> On 15/12/2005, at 12:32 AM, Mike Looijmans wrote:
> >>
> >>
> >>>> I've looked at connection pool code for a persistent database
> >>>> connection.   I don't know where to create the connection pool.
> >>>> If in the handler code (I'm using publisher), wouldn't a new
> >>>> pool be created each time the handler is called?
> >>>>
> >>>>
> >>> You'll get a new pool for each process (not for each thread)
> >>>
> >> Technically speaking, not necessarily. :-)
> >>
> >> There will actually be one per Python interpreter instance which uses
> >> that
> >> handler module. Thus if you were supporting two virtual hosts and
> >> both used
> >> the same handler module there would be one for each virtual host in each
> >> process. This even presumes the pool was created at global scope within
> >> the handler module. If it was created within the handler function
> >> itself, then
> >> there could be one per request.
> >>
> >> If pool was created at global scope within the handler module and module
> >> reloading is used, then over time you could end up with multiple
> >> pools with
> >> older ones potentially becoming inaccessible resources with a
> >> resource leak
> >> resulting. Resource pools should ideally be created in modules which are
> >> not the subject of mod_python module reloading.
> >>
> >> All this was what the referenced article and old mailing list posts
> >> help to
> >> describe.
> >>
> >> Graham
> >>
> >> _______________________________________________
> >> Mod_python mailing list
> >> Mod_python at modpython.org
> >> http://mailman.modpython.org/mailman/listinfo/mod_python
> >>
> >>
> >
> > _______________________________________________
> > Mod_python mailing list
> > Mod_python at modpython.org
> > http://mailman.modpython.org/mailman/listinfo/mod_python
> >
> >
>
>



More information about the Mod_python mailing list