Hi! Is it at all impossible to use XML-RPC _within_ a ZOPE architecture? What I mean is: I have a nested call structure: 1. Python script calls a method from a ZODB object 2. That method calls a Python module function 3. That module function dispatches an XML-RPC call to the same ZODB object called in step 1 4. This last call, which is rather complex, returns, and all the calls leading up to it return, sometimes doing some minor work When I use the same code _without_ any XML-RPC (the Zope server's self instead of the XML-RPC server object for that server), it works just fine. When I use XML-RPC, I get a ConflictError during the final return (from step 1), and I get it if I commit manually beforehand, so it must be the commit triggering it. The tricky thing is: nothing in my ZODB changes. I have several mutable _arguments_ that are passed on, but they are not default arguments and they don't get written to the ZODB. Is what I'm trying to do impossible for some reason? Or can I just make the whole call take place outside any transactions? Thanks in advance for any pointers, I'm really a little desparate at this point. Ole
Jan-Ole Esleben wrote at 2005-12-11 19:10 +0100:
Is it at all impossible to use XML-RPC _within_ a ZOPE architecture?
In principle yes. Be careful however: it is easy to introduce deadlocks! When during request processing you call back into the same Zope via XML-RPC, the calling out request will not complete until the XML-RPC returns a result (this always holds for calls, XML-RPC or other, to an external or internal server). Zope has a limited amount of workers (the default is 4) able to execute requests. If there are no free workers, requests have to wait for one. Now imagine that as many requests arrive as there are workers and each of them wants to perform an XML-RPC against the same Zope. Then you have a deadlock: none of the XML-RPC requests will finish, because there are no free workers. An no worker will ever become free again, because each of them waits for its XML-RPC to finish. Therefore, you should directly call internal resources (rather than use XML-RPC). -- Dieter
participants (2)
-
Dieter Maurer -
Jan-Ole Esleben