[Zope-dev] Making a ZSQL.DA fully multi-threaded?

Chris Withers chris at simplistix.co.uk
Fri Jul 16 03:57:48 EDT 2004


Brad Clements wrote:

> On 9 Jul 2004 at 21:17, Dieter Maurer wrote:
> 
> 
>>Check whether the connection is maintained in a "_v_" attribute
>>(in this case, it is per thread).
>>Otherwise, the connection would need to be maintained in a module
>>global registry indexed with a DA id (e.g. its ZODB path).
> 
> This is the deep magic of which my previous note speaks.
> 
> Where are these details documented (in general terms, not just about DA's), so that I can 
> figure this out without bugging the list too much?

Just checking: you do know that each thread in ZODB gets what appears to it to 
be it's own copy of the ZODB right?

So, even though there's only one connection stored in the class of the DA, 
that'll mean there's one DA connection opened up per Zope thread.

This often means that many more database connections are opened than are 
actually necessary. And if you start timing out inactive database connectiosn on 
the database side, you're in for a world of pain and suffering.

I branched ZOracleDA some time ago to move away from this model for that very 
reason...

What's the actual problem you're experiencing?

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk



More information about the Zope-Dev mailing list