We are using Plone and Zope against a legacy Ingres database, and I found a similar problem<br>
using the adapter provided.&nbsp; I found that the C library modules (open source) actually contained<br>
calls to make the adapter work as we wanted, much like our other web interfaces which maintain<br>
the db and user permissions info as a "connection", but close the actual query after each.&nbsp; I had<br>
to modify the Python Zope product to set "autocommit" and call the desired close in order to get <br>
the behaviour we were looking for -- keeping the connection, but releasing each session so that<br>
&nbsp;the DB backend does not register an active session between actual queries.<br>
<br>
That's open source.&nbsp; Code terminology for "re-write it".<br><br>----- Original Message -----<br>From: Jon Emmons &lt;jon.emmons@earthwavetech.com&gt;<br>Date: Wednesday, June 4, 2008 8:50<br>Subject: RE: [Zope] Multithreading sessions<br>To: 'Dieter Maurer' &lt;dieter@handshake.de&gt;<br>Cc: zope@zope.org<br><br>&gt; Dieter,<br>&gt; <br>&gt; Thanks for this input.&nbsp; Your comments here turned out to be <br>&gt; dead on.&nbsp; The<br>&gt; problem is the GIL.<br>&gt; <br>&gt; We are currently running Sybase databases using the python <br>&gt; Sybase-0.37<br>&gt; module for data access.<br>&gt; <br>&gt; This module will set the GIL.&nbsp; So if the query takes any <br>&gt; time at all, every<br>&gt; other session will freeze.&nbsp; It does release it when the <br>&gt; connection is<br>&gt; closed, but if the query takes awhile it effectively denies <br>&gt; service to every<br>&gt; other session.<br>&gt; <br>&gt; I am just learning about this, but my initial inquiries suggest <br>&gt; that the<br>&gt; only way to achieve true concurrency using a language like <br>&gt; python is to<br>&gt; launch multiple interpreters.<br>&gt; <br>&gt; I don't yet have the solution to my problem, but at least now I <br>&gt; know what<br>&gt; the problem is, and that is half the battle.<br>&gt; <br>&gt; Thanks again, and thanks to everyone's input, it has helped immensely.<br>&gt; <br>&gt; Jon Emmons<br>&gt; <br>&gt; -----Original Message-----<br>&gt; From: Dieter Maurer [mailto:dieter@handshake.de] <br>&gt; Sent: Wednesday, May 28, 2008 2:27 PM<br>&gt; To: Jon Emmons<br>&gt; Cc: zope@zope.org<br>&gt; Subject: Re: [Zope] Multithreading sessions<br>&gt; <br>&gt; Jon Emmons wrote at 2008-5-23 08:58 -0400:<br>&gt; &gt; ...<br>&gt; &gt;I am running zope 2.9.4 and have observed that it will not <br>&gt; simultaneously&gt;serve pages to my users.<br>&gt; <br>&gt; Usually, it does.<br>&gt; <br>&gt; I have seen database adapter packages (an old "psycopg" version, <br>&gt; to be<br>&gt; precise) that forgot to release the GIL for some operations.<br>&gt; Then Zope freezes while these operations are executed.<br>&gt; <br>&gt; <br>&gt; A surprising report of a similar kind was: while Zope's embedded<br>&gt; profiler is in use, Zope effectively runs in single thread mode (such<br>&gt; that other threads do not distort the timing results).<br>&gt; Probably not your problem ... but who knows.<br>&gt; <br>&gt; <br>&gt; Further potential reasons (for almost surely not responsible for your<br>&gt; current problem:<br>&gt; <br>&gt; &nbsp; Expensive operations implemented in "C" (such as <br>&gt; operations on huge<br>&gt; &nbsp; strings)<br>&gt; <br>&gt; &nbsp; Creating excessive amounts of objects (causing lots<br>&gt; &nbsp; of generation 2 garbage collections which hold the GIL)<br>&gt; <br>&gt; <br>&gt; <br>&gt; -- <br>&gt; Dieter<br>&gt; <br>&gt; _______________________________________________<br>&gt; Zope maillist&nbsp; -&nbsp; Zope@zope.org<br>&gt; http://mail.zope.org/mailman/listinfo/zope<br>&gt; **&nbsp;&nbsp; No cross posts or HTML encoding!&nbsp; **<br>&gt; (Related lists - <br>&gt; &nbsp;http://mail.zope.org/mailman/listinfo/zope-announce<br>&gt; &nbsp;http://mail.zope.org/mailman/listinfo/zope-dev )<br>&gt;