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

sathya zope2 at zeomega.com
Fri Jul 9 09:53:06 EDT 2004



sathya wrote:

> we have been looking at psycopg for postgres.
> zope opens atleast  one connection per zope thread. I have obeserved the 
> same for mysql as well. Are you creating your own threads within zope ? 
> in which case you have to do the locking yourself
> Brad Clements wrote:
> 
>> 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.
>>
>> I haven't yet looked at the Zsapdb source, but I think it has only one 
>> connection for all threads.
>>
>> Is there a document somewhere that explains how to make variables 
>> "thread private" in Zope? I vaguely recall something about one cache 
>> per thread, or that variables are read-
>> only shared unless updated by a thread, and then they're copied.. This 
>> is probably quite wrong, but obviously I just don't understand how 
>> data and threading works in Zope.
>>
>> So, I'm looking for a document that explains this clearly. How to have 
>> data that is not shared between threads (perhaps a kind of connection 
>> pool thingy).
>>
>>
>> Also, I have other projects where I really want to have just one 
>> object of it's kind no matter how many threads. For example, gvibDA 
>> uses Thunked_TM for this, but that doesn't really work with ZSQLDA 
>> because I've seen that multiple connect calls are made, even with the 
>> THUNKED_TM.
>>
>> Is there a "Zen Of" document about this somewhere?
>>
>> Thanks
>>
>>
>>
> 
> 


More information about the Zope-Dev mailing list