[Zope-DB] 2 sql methods issue (was Re: SQL Relay)

Jim Abramson jabramson at wgen.net
Mon Dec 15 11:32:16 EST 2003

Hello, folks, news to report on this peskiness:

>  > ...
>  > I've tried splitting the zope-based services we run onto 
> two separate zope instances, on the 
>  > same server, and unfortunately even in this case zope2 
> will not serve any requests while zope1 
>  > is using more than 1 database connection actively (note - 
> i have found that any action involving 
>  > a zope db connection, not just a sql method, will cause 
> this hogging situation).
> Thus, you need to find out, what your Zope2 instance is waiting for.
> I would use a ("C" level) debugger for this.

I've little working knowledge at this level, nor do I have any time to educate myself about it...(one of the reasons we're using Zope after all.) However I recently performed a variant on my earlier quick-and-dirty test, and found out that the problem is not what it seemed.

I will explain the test I performed and hope that someone out there can explain this interesting behavior. It's no less confusing - just (apparently) not the offender I'd thought it to be.


1. I set up an oracle proc which sleeps for 10 seconds and then returns. Instantiated a DCOracle2 SP object in zope. Wrote a dtml page called 'db' that dtml-calls the SP, then prints a message.

2. Set up another dtml page called 'nodb' that just prints a message - no db activity whatsoever.

3. Open 3 browser windows on the client machine.


1. in the first 2 browser windows, call 'db' page, then in the third, call 'nodb'. Notice that 'nodb' does not respond until the first 'db' page gets its response from Oracle and returns html. Thus, the apparent blocking situation.

(note that the above situation can be reproduced in a wide range of variations, including:

 - address zope differently in the first two browser windows that call 'db'. For example, in one I call zope by http://publiczopeaddress and in the other through a port-forwarded ssh tunnel as http://localhost:8888. Same results.

 - instantiate the test zope stuff on 2 different zope instances running on the same server, call 'db' in the first browser window from zopeinstance1 and in the second fromn zopeinstance2. Same results! this is what really blew me away.)


2. Open a _different_ browser on the client machine, and substitute that for one of the original browser windows. In my case I used an IE window and a NS window to each call 'db' simultaneously. Regardless of whether or not browser1 or browser2 are used as the third window to call 'nodb', guess what: NO BLOCK.

It seems therefore that something in Zope is blocking responses to a single identified client when database activities are in progress, not to one-at-a-time, which seems intuitive enough, but two-at-a-time (the second call to 'db' does not seem to get held up by the first....it's only subsequent requests while the first two are still active which get blocked). At least, that is the best theory I can come up with. Does this somehow fit into the zope worldview of anyone out there, with a deeper knowledge than I?


More information about the Zope-DB mailing list