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

Dieter Maurer dieter at handshake.de
Fri Jul 9 15:17:14 EDT 2004


Brad Clements wrote at 2004-7-9 09:35 -0400:
>I am using ZsapdbDA with SAPDB (now MaxDB) and have run into problems when Zope 
>has more than one thread.
>
>The folks at SAP suggest that there should be one database connection per thread, rather 
>than sharing one connection across threads.

This is the default for DAs as it is much easier to implement
one connection per thread than one connection per DA instance...

>I haven't yet looked at the Zsapdb source, but I think it has only one connection for all 
>threads.

Then do look at the source.
I would be astonished when you were right...

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).

-- 
Dieter


More information about the Zope-Dev mailing list