[Spambayes] ZODB simultaneous read-write is okay, right?

Tony Meyer tameyer at ihug.co.nz
Sun May 7 08:18:31 CEST 2006


[Skip]
>> I've switched from anydbm to ZODB for my SpamBayes database file.   
>> Just to
>> confirm, I can read and write simultaneously, correct?  I'm going  
>> back to
>> using sb_mboxtrain for training and using sb_bnfilter for scoring  
>> should
>> that make a difference.  I'd like to make sure the two processes  
>> can share
>> the same ZODB database.

[Tim]
> If you're using ZODB thru ZEO, any number of processes can have
> read-write connections to the database simultaneously.

There's a ZEO SpamBayes storage class in storage.py (basically it's  
the same as the ZODB one apart from the method that opens the  
storage).  I've used this without problem, although not anywhere near  
as extensively as the ZODB one.

[...]
> When a process with a read-only
> connection decides it wants to see current data, it should close its
> connection and DB, and re-open the storage from scratch (then create a
> new DB from the new FileStorage instance, then create a new Connection
> from the new DB).

     db.close()
     db = open_storage(db.name, "zeo", db.mode)

would do all of this, I believe.

=Tony.Meyer


More information about the SpamBayes mailing list