Concurrency and shelve

Michael Ströder michael at stroeder.com
Sun Mar 4 17:30:08 EST 2001


Erno Kuusela wrote:
> 
> In article <3AA26D5E.2FD28B40 at stroeder.com>, Michael Ströder
> <michael at stroeder.com> writes:
> 
> | Can anybody summarize issues with shelve (based on anydbm) and
> | concurrent access?
> 
> afaik only gdbm does locking, the others break.

Hmm, it seems to me that gdbm does prevent other processes from
opening the database at all.

Python 2.0 (#1, Oct 18 2000, 18:49:22) 
[GCC 2.95.2 19991024 (release)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> import gdbm
>>> d1=gdbm.open('/home/michael/test.dbm','c')
>>> d2=gdbm.open('/home/michael/test.dbm','c')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
gdbm.error: (11, 'Die Ressource ist zur Zeit nicht verf\374gbar')
>>>

BTW: I'm trying to use shelve to store web session data. How does
others solve this problem with the the standard lib without being to
DB-specific? Unpossible?

Ciao, Michael.



More information about the Python-list mailing list