ZODB: What does change if classes get persistent?
fgeiger at datec.at
Thu Feb 8 02:34:31 EST 2001
1) "How do you lock your web app data" was a question I asked about a week
ago (many thanks to all who contributed!!!). Alex Martelli pointed me to try
working with a database. So I started to do so. A few days later I came
across A.M. Kuchling's contribution "Alpha release of ZODB programming
guide". As I plan to "upgrade" my cgi lessons to Zope, I thought it'd be a
good idea to try ZODB which is part of Zope. I downloaded the package from
AMK's site and gave it a try, because it indeed sounds rather promising,
what I read in the docs.
So I played around but soon ran into troubles:
I have a class
class TCarts(TCollection, Persistence.Persistent):
which inherits from TCollection. TCollection wraps a dictionary.
After mixin' in Persistence.Persistent I get the following error
TypeError: unbound method must be called with class instance 1st argument
Does anybody know what's going on here behind the scenes?
2) A few contributors of "How do you lock your web app data" stated that
using a lock file to protect data against multiple access is somewhat
problematic especially in case of app crahes. This is the very problem I
encountered with my ferw lines of ZODB app! This astonished me a bit. ZODB
provides such sophisticated functionality to a user's app but runs into
troubles because of a simple lock file? BTW, the error message is
File "C:\Program Files\Python20\ZODB\lock_file.py", line 115, in lock_file
raise error, (StorageSystemError: Could not lock the database file.
There must be another process that has opened the file.
Any suggestions how to proceed? Did I miss something substantial?
Many thanks in advance and best regards
More information about the Python-list