[IndexedCatalog] Multithreading and IndexedCatalog
kiko at async.com.br
Fri Jun 27 10:19:54 BRST 2003
On Fri, Jun 27, 2003 at 03:09:41PM +0200, Syver Enstad wrote:
> Hi I am new to the list and to IndexedCatalog. I am posting because I
> am maintaining a system that uses IndexedCatalog and during testing of
> that system I get exceptions in IndexedCatalog if I use more than one
> thread to access the same object (from two differenct connections).
That's likely to be an exception in the ZODB. When using two threads in
the ZODB, the threads are [partially] isolated, each having their own
`view' of the objects; changes can be done independently and only after
one of these threads commit()s their changes can exceptions occur. I say
partial above, and here is the place to explain why: if you modify the
*same* object, or if you *modify*, *commit* in thread A and *read* in
thread B you will get exceptions (ConflictError and ReadConflictError,
If you're getting the latter, there is a patch by Dieter Maurer on
ZODB-list that reduces their occurence significantly (it's called the
"no more ReadConflictError" patch IIRC), so you can give it a try if
that's the exception you're getting.
If you do get to testing it, please let me know how it went, I've never
had the time to test it myself.
If not, well, it may very well be an IC bug 8)
> So my question is: What are the do's and don't's regarding
> IndexedCatalog and concurrency.
I'd like to see a traceback and then I can try and advise better. In
theory, barring ReadConflictErrors and the occasional
WriteConflictError, it should work correctly. In practice, however.. *
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
More information about the IndexedCatalog