[spambayes-dev] Re: -d/-D command line options

Kenny Pitt kennypitt at hotmail.com
Fri Feb 6 18:27:04 EST 2004


Skip Montanaro wrote:
> Barry> Let's say I went insane and decided to see if I could bang a
> Barry> transactional bsddb3 implementation together.  Where should I
> Barry> hook it in?  What interface should I try to support? 
> 
> Start with the DBDictClassifier class in spambayes.storage.  Hooking
> it in is easy.  Edit storage._storage_types and replace
> DBDictClassifier with your class or add another entry to it keyed by
> something like "tdbm". 

Without taking time to look at the code, it seems true transactional
support might need a little more than that.  Doesn't DBDictClassifier
just provide methods to update individual token counts?  I would think
the correct transactional approach would be:

1. Start a transaction before training from a single message
2. Attempt to train all tokens in the message
3. If any token update fails, rollback all count updates from that
message
4. If all tokens succeed, update the trained message count
5. If everything was successful, commit the transaction

-- 
Kenny Pitt




More information about the spambayes-dev mailing list