[ZPatterns] _v_dm_ KeyError calling get_transaction().abort()

Steve Spicklemire steve@spvi.com
Sun, 7 Oct 2001 20:39:34 -0500


Hi Itai,

	Just a wild guess. Maybe aborting the transaction clears out 
changes to both persistent and non-persistent attributes? (i.e., _v_dm, 
the DataSkin's Data Manager). Have you tried reversing the order of the 
getattr call and the abort?

-steve

On Sunday, October 7, 2001, at 08:31 PM, Itai Tavor wrote:

> Hi,
>
> I have a method of a DataSkin object that looks something like this:
>
>     def editMe(self, REQUEST, RESPONSE):
>         """ Edit object for customer """
>         ...
>         ...
>         if errors.has_any():
>             get_transaction().abort()
>             html = getattr(self, 'edit.html')(self, REQUEST, 
> errors=errors)
>             raise FormError, html
>
>
> The html = getattr() line causes the following exception. If I remove 
> the abort() line, this does not happen. Using Zope 2.3.2, ZPatterns 
> 0.4.3p2. I never had to abort transactions before, so I might be doing 
> something bad... but I can't see what it might be. Any ideas?
>
>
> Error Type: KeyError
> Error Value: _v_dm_
>
> Traceback (innermost last):
>   File /usr/local/zope/2.3.2/lib/python/ZPublisher/Publish.py, line 
> 223, in publish_module
>   File /usr/local/zope/2.3.2/lib/python/ZPublisher/Publish.py, line 
> 187, in publish
>   File /usr/local/zope/2.3.2/lib/python/Zope/__init__.py, line 221, in 
> zpublisher_exception_hook
>     (Object: 711)
>   File /usr/local/zope/2.3.2/lib/python/ZPublisher/Publish.py, line 
> 171, in publish
>   File /usr/local/zope/2.3.2/lib/python/ZPublisher/mapply.py, line 160, 
> in mapply
>     (Object: editMe)
>   File /usr/local/zope/2.3.2/lib/python/ZPublisher/Publish.py, line 
> 112, in call_object
>     (Object: editMe)
>   File /Users/itai/Z/Main/Products/PrintShop/Item.py, line 113, in 
> editMe
>     (Object: 711)
>   File /Users/itai/Z/Main/Products/ZPatterns/DataSkins.py, line 217, in 
> __get_attr__
>     (Object: 711)
> KeyError: (see above)
>
>
> -- --
> Itai Tavor                      -- "Je sautille, donc je suis."    --
> itai@optusnet.com.au            --               - Kermit the Frog --
> --                                                                 --
> -- "If you haven't got your health, you haven't got anything"      --
>
>
> _______________________________________________
> ZPatterns mailing list
> ZPatterns@eby-sarna.com
> http://www.eby-sarna.com/mailman/listinfo/zpatterns