Roundup Tracker - Issues

Message277

Author gmcm
Recipients
Date 2002-06-19.15:32:45
Message-id
In-reply-to
gdbm is many-readers or one-writer (and no readers).

That means that this pattern is unusable:

keyword = db.keyword 
while ...:
    try:
        id = keyword.lookup(....)
    except KeyError:
        id = keyword.create(....)
    .....
    db.commit()

So, I remove the long-lived ref and have:
while ...:
    try:
        id = db.keyword.lookup(....)
    except KeyError:
        id = db.keyword.create(....)
    .....
    db.commit()

This works *once*, but fails the 2nd time thru the loop.

HYPERDBDEBUG shows that a loop opens nodes.keyword
twice 'r' and once 'c'. I verified that the 'c'
instance opened in commit() is indeed closed in the
first pass. It's the 'c' open in the 2nd pass that
fails with "resource temporarily unavailable".

I'm mystified.
History
Date User Action Args
2009-02-03 14:20:02adminlinkissue571170 messages
2009-02-03 14:20:02admincreate