Concurrency and shelve

Erno Kuusela erno-news at erno.iki.fi
Sun Mar 4 19:29:10 EST 2001


In article <kuelwdkvq0.fsf at lasipalatsi.fi>, Erno Kuusela
<erno-news at erno.iki.fi> writes:

| In article <3AA2C1F0.980A23F7 at stroeder.com>, Michael Ströder
| <michael at stroeder.com> writes:

|| 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?

| don't keep it open all the time.

erm, i seem to have missed the "not db-specific" part. i guess
the answer is to do the locking yourself. there are some functions
in the fcntl module to do it. it's probably best to use a separate
empty file (like dbfilename + '.lock') that you do the locking on,
so that it does not interfere with gdbm's locking.

  -- erno



More information about the Python-list mailing list