[Zope-dev] How can I tell if an object in a ZODB is being activated? Concerns zope.app.module.importer.

Ross Patterson me at rpatterson.net
Fri Aug 3 20:12:13 EDT 2007


I'm working on zope.app.module.ZopePersistentModuleImporter.  As noted
in zodbcode.module.PersistentModuleImporter.__doc__, if the persistent
module registry which is consulted on import queries a persistent site
manager then the site manager must be activated before being queried or
a circular import problem occurs when the ZODB attempts to import the
globals necessary to activate the site manager.

The site manager will, however, eventually be deactivated, by a
transaction.abort() for example.  So I'm looking for a way that the
importer can know whether or now it's being called as a part of
activating the site manager.  I've written (and attached diffs for) a
very ugly function that inspects the frame stack to detect if the site
manager is being activated just to demonstrate what I'm looking for.

Is there a way to ask an object if it's being activated?  Or what might
be a better approach to solving this problem?

Ross

-------------- next part --------------
A non-text attachment was scrubbed...
Name: zam.diff
Type: text/x-diff
Size: 4613 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20070803/852bdc39/zam.bin


More information about the Zope-Dev mailing list