[Zope-dev] Re: SQLAlchemy integration experiment

Martijn Faassen faassen at startifact.com
Tue Jun 17 11:28:24 EDT 2008


Hey Laurence,

Laurence Rowe wrote:
[snip]
> I'm not sure connection pooling is really useful in a threaded 
> environment with recycled sessions. You want n threads = n connections. 
> If we started creating new sessions each request then things would be 
> different.

Mike Bayer says the following:

 > you should reuse a single engine.  It contains a pool of connections,
 > so recreating engines means new connections are constantly rebuilt and
 > it defeats the purpose of the pool.  Other than that the creation of
 > an engine is not very expensive but even a small expense is needless
 > here.

I explained to him we'd only end up creating a single engine per thread 
(and app), and we'll see what he has to say about that.

I'm leaning towards trying to recycle the engines, though.

Regards,

Martijn



More information about the Zope-Dev mailing list