Jeffrey W. Baker wrote:
I wasn't aware of these issues before.  Looks like I'll have to use
BerkeleyDB or Tie::DB_Lock or something.

On closer inspection I think it's mostly okay because the session object is supposed to go out of scope and get destroyed (and thus untie) after every interaction, and the locking should mean that only process is writing during that time. You could run into trouble though if a process is able to open for reading and then later do writes without closing and re-opening the file first, and it looks like that does happen. This could lead to lost updates from other processes.


I'd suggest either looking at how MLDBM::Sync works, or using BerkeleyDB instead. BerkeleyDB can be tricky to get right, but it's significantly faster than any other storage mechanism supported by Apache::Session.

The corruption problems in this thread could also have been caused by the usual suspect -- scoping issues. If the session object doesn't get destroyed, it will keep the file open, and that is definitely not safe.

- Perrin


-- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to