[Zope-dev] ConnectionStateError
Hanno Schlichting
hanno at hannosch.eu
Wed Jan 12 11:06:25 EST 2011
On Wed, Jan 12, 2011 at 2:34 PM, Godefroid Chapelle <gotcha at bubblenet.be> wrote:
> I understand that I should look for persistent objects stored in module
> or class level variables (which imply shared by threads and thus
> connections). Do not hesitate to tell me if this is a wrong explanation
> of the potential cause of ConnectionStateError.
>
> However, I wonder if some of you could give debugging techniques outside
> reviewing the code.
Do you get the classic: "Shouldn't load state for %s when the
connection is closed" or one of the "The database connection is
closed" errors?
In the first case you get the p_oid, which you can load from the
database to give you some clue on what class it is.
Typical problems include using plone.memoize decorators on things
without knowing where exactly the cache is stored or as someone else
noted registering persistent objects in the global site manager
instead of the local one. The global one is of course just a module
global data structure in the end.
Hanno
More information about the Zope-Dev
mailing list