[Zope] Zope Freezing up with multiple threads accessing
objects.
Etienne Labuschagne
elabuschagne@gmsonline.co.za
Wed, 16 Jul 2003 00:48:10 +0200
>> Etienne Labuschagne wrote at 2003-7-14 13:29 +0200:
>> > Ok, I have narrowed down my problem to the following, when calling
>> > get_transaction().commit(), the :
>> > ...
>> > in ZODB.BaseStorage.BaseStorage
>> >
>> > tpc_finish line 155: if transaction is not self._transaction: return
>>
>> It appears as if the same connection were used in two different
>> threads. Do not do that...
>>
>>
>> Dieter
Hi Dieter,
That was my initial though too (since that was how I was originally
introduced to opening my own connections!). I'm quite sure it's not that
as a typical debug run would go like this:
Thread 703 - Start of Commit
Thread 703 - Acquire DB Lock
Thread 703 - Release DB Lock
Thread 703 - Acquire DB Lock
Thread 703 - End of Commit
The above is abbreviated, but I can send you a more verbose list with stack
traces for each step. I printed out the
threading.currentThread().getName()s every step to check which threads are
doing what.
Coming to think of it, the above probably only proves that the commit
happens in one thread, not that the objects that are committed weren't
changed by multiple threads.
Anyway, I will go through my code with a fine comb again as me being sure I
don't use a connector from different threads does not mean it isn't so!
At the least I will try and give more information trying to prove it isn't
so :)
Thanks anyway.
Etienne