Re: ZEditingContextSessioning failing to init
Sébastien Bigaret <[email protected]> Fri, 03 Mar 2006 21:50:13 +0100
| Newsgroups | gmane.comp.python.modeling |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--------------020504010105010902040702
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by coliposte.enst-bretagne.fr id k23KpvWi001392
Hi Paul,
Paul Mylchreest wrote :
> Greetings,
>=20
> In the process of starting my zope server, getting this error:
>=20
> ------
> 2006-03-03T10:29:05 ERROR(200) Products.ZEditingContextSessioning The
> session data container's destruction callback already set --
> installation aborted
> ------
The message you get is a security mechanism.
It notifies you that an other Product (or maybe you) already set the dest=
ruction callback of the sessions data container.
The ZECS (ZEditingContextSessionning) decides not to override it when it =
is already set, because if you (or another Product) already rely on it, s=
ome special action needs to be taken (namely: calling the already registe=
red callback before or after ZECS's one).
Frankly, you're the 1st person reporting such a collision; I suspect that=
the zeo configuration is the reason.
Could you please tell us which callback is registered: in the ZMI, go to =
/temp_folder/session_data and look at the value entered under the field '=
Script to call when objects are deleted' ? I appreciate your time --hope=
fully we'll quickly find a fix for the problem.
In the meantime, if you want to try the ZECS despite the problem, just ap=
ply the attached patch: the installation won't be stopped because of that=
situation. Be aware, however, that the patch shouldn't be installed in =
a production environment if you're using SESSION.defaultEditingContext: i=
f the deletion hook is not properly installed, then a session's EC will n=
ever be garnaged collected when a session expires, causing the memory foo=
tprint to grow, and grow, and grow!
In a test/dev environment this should not be a problem however.
-- S=E9bastien.
> My config is:
> OSX Tiger
> python 2.3.5
> Zope 2.7.6
> Modeling-0.9
> ZModeling-0.9
>=20
> I have a zeoclient(1)/zeoserver setup and I used
> <http://longsleep.org/howto/sharesessionwithzeo> for configuration of
> the session storage. Also getting the same error with previous version.
>=20
> Any ideas?
>=20
> Paul
--------------020504010105010902040702
Content-Type: text/x-patch;
name="ZECS.patch"
Content-Disposition: inline;
filename="ZECS.patch"
Content-Transfer-Encoding: 7bit
Index: __init__.py
===================================================================
--- __init__.py (revision 986)
+++ __init__.py (working copy)
@@ -89,10 +89,12 @@
app=context._ProductContext__app
sessionDataContainer=app.temp_folder.session_data
+ install_delete_hook=1
if sessionDataContainer.getDelNotificationTarget():
- zLOG.LOG('Products.ZEditingContextSessioning', zLOG.ERROR,
- "The session data container's destruction callback already set -- installation aborted")
- return
+ zLOG.LOG('Products.ZEditingContextSessioning', zLOG.WARNING,
+ "The session data container's destruction callback already set (%s)-- THIS IS A MODIFIED VERSION OF THE PRODUCT, WHICH SHOULD NOT BE PUT IN A PRODUCTION ENVIRONMENT"%repr(sessionDataContainer.getDelNotificationTarget()))
+ install_delete_hook=0
+ ##return
# There is no SessionObject, just Transient Object
if getattr(TransientObject, 'defaultEditingContext', None):
@@ -106,7 +108,8 @@
## Transient Object Container's ZMI will not show a meaningful value for
## its field 'Script to call when objects are deleted'
#sessionDataContainer.setDelNotificationTarget(sessionDeletion_hook)
- sessionDataContainer.setDelNotificationTarget('/Control_Panel/Products/ZEditingContextSessioning/sessionDeletion_hook')
+ if install_delete_hook:
+ sessionDataContainer.setDelNotificationTarget('/Control_Panel/Products/ZEditingContextSessioning/sessionDeletion_hook')
product=app.Control_Panel.Products.ZEditingContextSessioning
--------------020504010105010902040702--
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642