[ZODB-Dev] cPickleCache: "Cache values may only be in one cache" error

Jeremy Hylton jeremy at zope.com
Fri Jan 23 14:27:32 EST 2004


On Fri, 23 Jan 2004 20:11:25 +0100
 Andreas Jung <lists at andreas-jung.com> wrote:
> I am currently working on a Plone 2 application where I
> get the error frequently.
> The application is based on Archetypes 1.3. It seems that
> is has something to do
> with the so-called ImageField that stores an image and
> scaled versions of the image
> as attributes of a persistent object (attributes are
> OFS.Image instances).
> The error occurs when I render all scaled version of the
> images within transaction
> in a HTML page.Any ideas what causes this error?

I can only give you a useless answer:  You're getting the
error because an object loaded from one cache is being
insert into another cache.  It should be really hard to do
that.  Do you have a traceback?  Or several?

It would be interesting to know if both caches were
associated with the same Connection.  Perhaps the cache is
reset, _resetCache() method, but an object is still fetched
from the old cache.  Then the exception would be raised
when it's added to the new cache.  Again, I don't see how
that would be possible given the current code.

Is it possible that multiple threads are interacting with
the same Connection?  Or that some application code grabs
_p_jar and attempts to use it across Zope requests?  Then
you'd have two different Connection objects associated with
a single thread.

Jeremy



More information about the ZODB-Dev mailing list