[ZODB-Dev] DisconnectedError

2007-05-04 Thread José Pedro Ferreira

Hello.
I am experiencing a problem with ZODB-3.6.0 / Python 2.5, under Linux.
Each time I initialize a database, i get a DisconnectedError exception 
in the client, with the following traceback:


quote

 File /home/pferreir/workspace/indico/code/code/MaKaC/common/db.py, 
line 50, in __init__

   self._db=MaKaCDB(self._storage)

 File /usr/local/lib/python2.5/site-packages/ZODB/DB.py, line 238, in 
__init__

   storage.load(z64,'')

 File /usr/local/lib/python2.5/site-packages/ZEO/ClientStorage.py, 
line 746, in load

   return self.loadEx(oid, version)[:2]

 File /usr/local/lib/python2.5/site-packages/ZEO/ClientStorage.py, 
line 769, in loadEx

   data, tid, ver = self._server.loadEx(oid, version)

 File /usr/local/lib/python2.5/site-packages/ZEO/ServerStub.py, line 
192, in loadEx

   return self.rpc.call(loadEx, oid, version)

 File /usr/local/lib/python2.5/site-packages/ZEO/zrpc/connection.py, 
line 531, in call

   r_flags, r_args = self.wait(msgid)

 File /usr/local/lib/python2.5/site-packages/ZEO/zrpc/connection.py, 
line 621, in wait

   raise DisconnectedError()

DisconnectedError

/quote

In the server side, I get:

quote

2007-05-04T16:20:36 (11926) new connection ('127.0.0.1', 38126): 
ManagedServerConnection ('127.0.0.1', 38126)

2007-05-04T16:20:36 (127.0.0.1:38126) received handshake 'Z303'
2007-05-04T16:20:36 (127.0.0.1:38126) loadEx() raised exception: 0x00
Traceback (most recent call last):
 File /usr/local/lib/python2.5/site-packages/ZEO/zrpc/connection.py, 
line 421, in handle_request

   ret = meth(*args)
 File /usr/local/lib/python2.5/site-packages/ZEO/StorageServer.py, 
line 248, in loadEx

   return self.storage.loadEx(oid, version)
 File 
/usr/local/lib/python2.5/site-packages/ZODB/FileStorage/FileStorage.py, 
line 523, in loadEx

   pos = self._lookup_pos(oid)
 File 
/usr/local/lib/python2.5/site-packages/ZODB/FileStorage/FileStorage.py, 
line 514, in _lookup_pos

   raise POSKeyError(oid)
POSKeyError: 0x00
2007-05-04T16:20:36 (11926/127.0.0.1:38126) disconnected
2007-05-04T16:20:36 (11926) new connection ('127.0.0.1', 38127): 
ManagedServerConnection ('127.0.0.1', 38127)

2007-05-04T16:20:36 (127.0.0.1:38127) received handshake 'Z303'

/quote

What confuses me is that I though that a root object for the database 
would be created by the client, and a DisconnectedError is raised before 
that happens. What can be happening?


Thanks in advance,

Pedro
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] DisconnectedError

2007-05-04 Thread José Pedro Ferreira

Gary Poster wrote:

Hi. ZODB does not currently work with Py2.5.

Gary

OK, thanks.
However, I was able to make it work, running this simple script, and 
then running the application again.


quote

#!/usr/bin/python

import ZODB
from ZODB import FileStorage, DB
import transaction

storage = FileStorage.FileStorage(zeo/data.fs)
db = DB(storage)
connection = db.open()
dbroot = connection.root()


transaction.commit()

connection.close()
db.close()
storage.close()

/quote

And now it works perfectly :).
Is there any possible explanation for this?

Thanks again,

Pedro
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] DisconnectedError

2007-05-04 Thread José Pedro Ferreira

Jim Fulton wrote:


I don't know why the client is being disconnected.  As others have 
hinted, you should try this with Python 2.4 -- and please report back 
if that changes the outcome.


OK, I've tested it with Python 2.4.4, and it worked OK. For Python 2.5, 
I had to use the hack I posted in the last mail (weird...).


Best regards,

Pedro Ferreira
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] DisconnectedError

2007-05-04 Thread José Pedro Ferreira
Yes, the DB did not exist. And yes, it's not a hack, it's only opening 
and closing the database... but it unexpectedly works after doing it.


Cheers,

Pedro


On May 4, 2007, at 11:25 AM, José Pedro Ferreira wrote:


Jim Fulton wrote:


I don't know why the client is being disconnected.  As others have 
hinted, you should try this with Python 2.4 -- and please report 
back if that changes the outcome.


OK, I've tested it with Python 2.4.4, and it worked OK. For Python 
2.5, I had to use the hack I posted in the last mail (weird...).


I don't really see a hack.  All you did was open the database as 
usual.  Before you ran your script with the hack, did you make sure 
the database did not exist?


Jim

--
Jim Fultonmailto:[EMAIL PROTECTED]Python Powered!
CTO (540) 361-1714http://www.python.org
Zope Corporationhttp://www.zope.comhttp://www.zope.org





___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev