[ZODB-Dev] Invalidating caches for module refresh doesn't seem to work

Dieter Maurer dieter at handshake.de
Thu Feb 1 15:12:57 EST 2007


Philipp von Weitershausen wrote at 2007-1-29 23:46 +0100:
>After refreshing a product, Zope 2 uses the following stanza in 
>App.RefreshFuncs.autoRefresh() to let the ZODB know that it should 
>invalidate its pickle caches:
>
>         ... refresh products
>         from ZODB import Connection
>         Connection.resetCaches()

In fact, the lines above should be already sufficient.
> ...
>Testing product refresh with both Zope 2.9 and 2.10 produces errors for 
>me while Zope 2.8 works, which leads me to the assumption that a cache 
>invalidation bug was introduced after ZODB 3.4. Is anybody else seeing 
>this? I'm a bit surprised nobody else has complained about this so far...

Lots of people have complained that refreshing stopped working in
Zope 2.9.

Unfortunately, this is incomprehensible.

  After "resetCaches()", the next "_setDB" operation (which happens
  as part of each "DB.open()"), will delete the old cache and
  create a new one. This means that all objects need to get
  loaded from the storage and in constructing them, the new classes
  must be used (as the old ones are no longer in "sys.modules").

Thus, we have a few possibilities:

  * the "resetCaches() no longer ensures that the cache is deleted
    and a new one created

  * "_setDB" is no longer called in "DB.open()"

  * for some reasons, the old modules are still in "sys.modules".



-- 
Dieter


More information about the ZODB-Dev mailing list