Re: [Zope-dev] ZPatterns: transaction bug
ZPatterns 0.4.2a1 PlugIns.py bug? I get a 'Name Error' aq_base when I hit the following code while trying to update the index_html method of one of my Specialists from CVSMixin.. I think that this would get hit anytime you add an object whose id is already in the acquisition path -steve diff -c -r1.1.1.2 PlugIns.py *** PlugIns.py 2000/09/04 14:17:29 1.1.1.2 --- PlugIns.py 2000/09/04 18:53:17 *** *** 265,271 # An object by the given id exists either in this # ObjectManager or in the acquisition path. flags = getattr(obj, '__replaceable__', NOT_REPLACEABLE) ! if hasattr(aq_base(self), id): # The object is located in this ObjectManager. if not flags REPLACEABLE: raise 'Bad Request', ('The id "%s" is invalid - ' \ --- 265,271 # An object by the given id exists either in this # ObjectManager or in the acquisition path. flags = getattr(obj, '__replaceable__', NOT_REPLACEABLE) ! if hasattr(self.aq_base, id): # The object is located in this ObjectManager. if not flags REPLACEABLE: raise 'Bad Request', ('The id "%s" is invalid - ' \ ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns: transaction bug
While updating a load of DataSkins all together using a ZCatalog, I got this error: 2000-09-03T08:03:13 PANIC(300) ZODB A storage error occurred in the last phase of a two-phase commit. This shouldn't happen. The application may be in a hosed state, so transactions will not be allowed to commit until the site/storage is reset by a restart. Traceback (innermost last): File lib/python/ZODB/Transaction.py, line 296, in commit File lib/python/Products/ZPatterns/Transactions.py, line 108, in tpc_finish File lib/python/Products/ZPatterns/Transactions.py, line 137, in end_tran File lib/python/Products/ZPatterns/Transactions.py, line 48, in _unregister (Object: ProviderContainer) KeyError: _v_registered The line from Transactions.py in question is: def _unregister(self): del self._v_registered From a little bit of instrumentation, I see that one of my Customizer instances is getting unregistered twice in a row. An obvious naive fix is to put the del line in a try-except block, or to change it to if self._v_registered: del self._v_registered From a lot of instrumenting code, tinkering and reading up on the ZODB transaction system, I think I've found what the problem is. The error happens when the ZCatalog attempts to commit a subtransaction. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns: transaction bug
**Darn**; I pressed the send button on my mail client by accident while still working on this one. Ignore the last message. I think the error is to do with the way that ZPatterns.Transactions.Reporter doesn't do anything special for subtransactions. On committing a subtransaction, it commits the top-level transaction that it knows about. Then again, I'm new to the way ZODB handles transactions, so I might well be wrong here. More later... -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns transaction bug
I have a trigger that is a datamanager-plugin for a Customizer folder. The trigger listens to ADD events. If the trigger rasies an exception as it is notified that a new DataSkin object is being added beneath the customizer folder, I get a ZODB error: 2000-08-27T09:25:38 ERROR(200) ZODB Couldn't load state for '\000\000\000\000\000\000*\336' Traceback (innermost last): File /usr/local/zope/SiteBox/lib/python/ZODB/Connection.py, line 442, in setstate File /usr/local/zope/SiteBox/lib/python/ZODB/FileStorage.py, line 587, in load (Object: /usr/local/zope/SiteBox/var/Data.fs) File /usr/local/zope/SiteBox/lib/python/ZODB/FileStorage.py, line 563, in _load (Object: /usr/local/zope/SiteBox/var/Data.fs) KeyError: *Þ Sometimes I get slightly different errors, where Zope refuses to commit any more transactions. Zope 2.2.1, ZPatterns 0-4-1snap1 with the DataSkins patch I posted a few minutes ago. -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )