[ZODB-Dev] problem with Connection.sync() on empty database

John Belmonte jvb at prairienet.org
Wed Oct 1 15:50:53 EDT 2003


I'm having a strange ZODB problem with my application.  Basically, if I 
call Connection.sync() on a database that is empty, then later 
modifications to the database never get written to disk.  This is 
happening with both file storage and ZEO.  I'm using ZODB3-3.2b3.

I tried to make a minimal test that is independent from my app, but 
failed to make the problem appear.  So either there is a problem with my 
app's use of ZODB, or there is some subtle bug in ZODB.

One run of my app has the following structure:

     open storage, db, connection
     sync connection
     modify database
     commit transaction
     close storage, db, connection

You may wonder why I bother with a sync if I've just opened the 
connection.  Well, this is a web app, and the sequence shown above is 
for the case of CGI.  When I use mod_python, the program will loop over 
the sync/modify/commit sequence.  I want to use the same code for both 
CGI and mod_python, hence the sync is always called.

As I said, with the sequence above and when the database is empty, the 
transaction never gets written to disk.  No errors are emitted.  If I 
remove the sync call just for one run, so that the initial transaction 
is written to disk and the database is no longer empty, from there 
commits work fine even after I replace the call to sync.

Any ideas about what is going on?

-John Belmonte


-- 
http:// if   le.o  /




More information about the ZODB-Dev mailing list