[ZODB-Dev] ZODB from mod_python

Hector Sanchez SanMartin Hector.Sanchez@cern.ch
Fri, 17 Jan 2003 11:14:08 +0100


  Hello,

  I'm having some troubles when connecting from a script that is 
executed under mod_python to a ZEO server that keeps the ZODB. It's very 
strange because no problem when connecting from a CGI or a command line 
one, there everything works perfectly; but when trying to connect from 
the mod_python one it hangs until apache kills the connection.
The piece of code I'm using is rather simple:

from mod_python import apache

def handler(req):
        req.content_type="text/html"
        req.send_http_header()

        import sys
        from ZEO.ClientStorage import ClientStorage
        b = ClientStorage( ('test.cern.ch', 9999) )
        req.write("connected")
        return apache.OK

I have also activated the log on the ZEO and the only thing I get is:
2003-01-17T11:05:35 INFO(0) ZCS:1628 ClientStorage (pid=1628) created 
RW/normal
for storage: '1'
------
2003-01-17T11:05:35 INFO(0) ZEC ClientCache: storage='1', size=20971520; 
file[0]
=None

I have also debugged a bit in the ClientStorage the code and the hanging 
happens when doing:
       self._rpc_mgr = self.ConnectionManagerClass(addr, self,
                                                    
tmin=min_disconnect_poll,
                                                    
tmax=max_disconnect_poll)
       if wait:
            self._rpc_mgr.connect(sync=1)

  Any ideas? I'm sure it must be something quite simple but cannot 
figure out what it is, so if someone could help me it would be wonderful

  Thanks in advance...

-- 
Hector Sanchez

CERN Document Server ** <http://cds.cern.ch/> ** <cds.support@cern.ch>
InDiCo Project       ** <http://indico.sissa.it>
Room: Bldg 510-R-007 ** Voice: +41-22-7673829 ** Fax: +41-22-7678142