[spambayes-dev] A new and altogether different bsddb breakage
Barry Warsaw
barry at python.org
Wed Dec 17 20:31:01 EST 2003
On Wed, 2003-12-17 at 20:16, Tim Peters wrote:
> Having never written anything myself using bsddb3's "real" interface, I
> can't say how hard that would be. I *expect* it would actually be easy for
> someone with a non-trivial understanding of BDB. The only use we have for
> BDB now is to use it as if it were a giant dict -- it probably doesn't get
> any simpler than that.
If you map all square-bracket setitems to .put()'s and square-bracket
getitems to .get()'s, it's fairly straightforward. That is, provided
you can define the transaction boundaries so you can call txn begin,
abort, and commit at the Right Times. You will want to pass the BDB txn
object into the .gets and .puts to make it all work smoothly. Add a
little extra goo to create the environment if it doesn't exist (or join
it if it does), and viola! or contrabasso!
-Barry
More information about the spambayes-dev
mailing list