[Zope-DB] ConnectionStateError when accessing properties

robert rottermann robert at redcor.ch
Mon Apr 26 06:20:15 EDT 2010


Hi there,

in a plone site where Data is partially maintained in a mysql db, I get a
ConnectionStateError when I try to access properties on the sit.

the error is as follows:

Time  	2010/04/25 15:10:28.998 GMT+2
User Name (User Id) 	beat (beat)
Request URL
http://www.energie-plattform.ch/data_folders/save_company_changes/save_company_changes
Exception Type 	ConnectionStateError
Exception Value 	Shouldn't load state for 0x1cbe82 when the connection is closed

Traceback (innermost last):

    * Module ZPublisher.Publish, line 119, in publish
    * Module ZPublisher.mapply, line 88, in mapply
    * Module ZPublisher.Publish, line 42, in call_object
    * Module <wrapper>, line 5, in wrapper
    * Module kss.core.actionwrapper, line 238, in apply
    * Module energiecluster.addresses.browser.company, line 465, in
save_company_changes
    * Module energiecluster.addresses.Flag, line 400, in handleFlags
    * Module energiecluster.addresses.Flag, line 542, in delFlagsFromObject
    * Module energiecluster.addresses.Flag, line 572, in updateHooks
    * Module energiecluster.addresses.Newsletteremail, line 248, in hookupFlags
    * Module energiecluster.addresses.Newsletteremail, line 188, in _hockedupFlags
    * Module energiecluster.addresses.Newsletteremail, line 216, in getHookedFlags
    * Module ZODB.Connection, line 758, in setstate

ConnectionStateError: Shouldn't load state for 0x1cbe82 when the connection is
closed

the code that produces the error is the line
    if not ep.hasProperty('newsletter_hooked_flags'):

in a call of the following method:

def getHookedFlags(self):
    if not self.context:
        return
    pt = self.context.portal_properties
    ep = getattr(pt.aq_inner.aq_self, 'energiecluster_properties', None)
    if not ep:
        ep = SimpleItemWithProperties(id='energiecluster_properties',
          title='energiecluster_properties')
        pt._setObject('energiecluster_properties', ep)

    if not ep.hasProperty('newsletter_hooked_flags'): <--------- error here
        values = [
            '#language:Type:Flag1',
            '#where type 0 = html, type 1 = text',
            'de:0:ad_newsletter_de_html',
            'de:1:ad_newsletter_de_text',
            'fr:0:ad_newsletter_fr_html',
            'fr:1:ad_newsletter_fr_text',
        ]
        ep.manage_addProperty(id='newsletter_hooked_flags',
            value=values, type='lines')
    return  ep.getProperty('newsletter_hooked_flags')

unfortunately this happens only on the life site. I can not reproduce the error
in our test environment.

I would very much appreciate a hint how to circumvent that error.
thanks
robert


More information about the Zope-DB mailing list