[pybsddb] missing convenience method for join cursor, stability question

Ryan Olf ryan at efrus.com
Sat Feb 2 11:03:10 CET 2013


Hello everyone,

There is a convenience method join_item() in the cursor class for iterating
through join cursors with the flag DB_JOIN_ITEM. This flag causes the
method to return the primary key only, and not the data. To get the key and
data, one is supposed to call cursor->get() with flags = 0. This can easily
be done with the python bindings (cursor.get(flags=0) does the trick), but
I'm wondering if there should be a convenience method that does this, since
the documentation stresses that one should never have to call get()
directly.

And now a question: as I'm debugging my code on a test database, I
sometimes find that python hangs and I am forced to close it down
forcefully. I'm worried that this leaves cursors and/or db handles open,
because upon restarting after one of these instances, I find that python
hangs everytime I do a cursor->get(), for example. If I rebuild my database
from scratch, I am again problem free and don't hang until I mess up again.
For the record I'm using DB_AUTO_COMMIT, using a single thread, and
generally not doing anything that I imagine could corrupt the database. I
could be wrong...

My question is this: is there something I can do to recover from this
situation that doesn't involve dumping and rebuilding the database? It
occurs to me that I haven't tried rebooting, but perhaps there is some
magic that shuts down abandoned handles and makes everything happy again?

Thanks so much, I'm really enjoying using this new tool, with just a few
kinks...

Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.jcea.es/pipermail/pybsddb/attachments/20130202/fbdfdd9b/attachment.html>


More information about the pybsddb mailing list