Re: ConnectionStateError

Godefroid Chapelle <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
Le 12/01/11 17:06, Hanno Schlichting a écrit :
> On Wed, Jan 12, 2011 at 2:34 PM, Godefroid Chapelle<[email protected]>  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.

Thanks for help from anyone.

Once debugged, I'll blog how I found the bug.

> 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.

I had no clue that the number in the error message was the p_oid. I 
could have found out by reading the code.

Nevertheless, I propose to make the error message more self-explanatory.

> 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

-- 
Godefroid Chapelle (aka __gotcha) http://bubblenet.be

_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.