RE: [Zope] Hourly restarts of Zope
-----Original Message----- From: Jason Abate [mailto:jason@hostway.net] Sent: Wednesday, December 15, 1999 10:17 PM To: zope@zope.org Subject: [Zope] Hourly restarts of Zope
I've noticed an odd Zope behavior while experimenting with the __setstate__() method. Zope is being restarted every hour (5:05 past the hour, to within a several seconds). I've scoured my machine for any cron job that might be causing this but haven't found any. Is this a known Zope behavior?
Nope?
Any idea of what else might cause this?
Are you calling Persistent.__setstate__(self, state) in your setstate method? If you don't call it, the persistent machinery would probably be very unhappy, and since it's written in C, might core dump... just an idea. -Michel
Michel-
Are you calling Persistent.__setstate__(self, state) in your setstate method? If you don't call it, the persistent machinery would probably be very unhappy, and since it's written in C, might core dump... just an idea.
Where is the Persistent class defined? All I can find is lib/python/Persistence.py, but that only contains the Zope license information and a doc. string. No actual classes are defined there. When I try to subclass Persistent, I get an error about the class not being found:
import Persistence class myclass(Persistence.Persistent): ... def __init__(self): ... print "In init" ... Traceback (innermost last): File "<stdin>", line 1, in ? AttributeError: Persistent
Am I missing something here? Do things work differently if the module is written in C? Thanks, -jason -- Jason Abate Hostway Corporation jason@hostway.com
Jason Abate wrote:
Michel-
Are you calling Persistent.__setstate__(self, state) in your setstate method? If you don't call it, the persistent machinery would probably be very unhappy, and since it's written in C, might core dump... just an idea.
Where is the Persistent class defined?
It's a C class, defined in lib/python/ZODB/cPersistent.c.
All I can find is lib/python/Persistence.py,
Persistence.py can be thought of as a registry. A database, like BoboPOS or ZODB stuffs it's persist class there when it is imported. This allows application code to be written that doesn't depend on the specific database used.
but that only contains the Zope license information and a doc. string. No actual classes are defined there. When I try to subclass Persistent, I get an error about the class not being found:
import Persistence class myclass(Persistence.Persistent): ... def __init__(self): ... print "In init" ... Traceback (innermost last): File "<stdin>", line 1, in ? AttributeError: Persistent
Am I missing something here?
You need to import ZODB first. import ZODB, Persistence class myclass(Persistence.Persistent): ... The idea is that a "main" module (like Zope) imports ZODB before ant application modules are imported so that Persistence has Persistent when needed.
Do things work differently if the module is written in C?
In this case, the difference arises from the way the Perssitence module is used as a sort of registry. Jim -- Jim Fulton mailto:jim@digicool.com Technical Director (888) 344-4332 Python Powered! Digital Creations http://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
Michel Pelletier wrote:
-----Original Message----- From: Jason Abate [mailto:jason@hostway.net] Sent: Wednesday, December 15, 1999 10:17 PM To: zope@zope.org Subject: [Zope] Hourly restarts of Zope
I've noticed an odd Zope behavior while experimenting with the __setstate__() method. Zope is being restarted every hour (5:05 past the hour, to within a several seconds). I've scoured my machine for any cron job that might be causing this but haven't found any. Is this a known Zope behavior?
Nope?
Any idea of what else might cause this?
Are you calling Persistent.__setstate__(self, state) in your setstate method? If you don't call it, the persistent machinery would probably be very unhappy,
No, not at all.
and since it's written in C, might core dump... just an idea.
No, the fact that it's written in C makes no difference. Jim -- Jim Fulton mailto:jim@digicool.com Technical Director (888) 344-4332 Python Powered! Digital Creations http://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (3)
-
Jason Abate -
Jim Fulton -
Michel Pelletier