[ZODB-Dev] Transaction undo example

Patrick DECAT pdecat at gmail.com
Tue Apr 12 06:29:11 EDT 2005


Hi,

if you want to abort the current transaction, here is a sample
inspired from Zope's code:
    def some_method(self, REQUEST, RESPONSE):
        """Do stuff"""
        try:
            # Do important stuff
            RESPONSE.setStatus(204)
        except:
            RESPONSE.setStatus(500)
            get_transaction().abort()

        return RESPONSE

HTH,
Patrick.

On Apr 12, 2005 11:24 AM, Stefan Milenkovic <smilenko at gmail.com> wrote:
> Hello,
> 
> I am relatively new to ZODB and I have to work for some reasons with
> the transactions.
> 
> I am trying to undo a transaction, but until now it has been
> unsuccessful. Maybe I don't know how to do it exacltly...
> 
> So is there someone who can give me a small example of a transaction undo?
> 
> Thanks in advance,
> 
> Stefan
> _______________________________________________
> For more information about ZODB, see the ZODB Wiki:
> http://www.zope.org/Wikis/ZODB/
> 
> ZODB-Dev mailing list  -  ZODB-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zodb-dev
>


More information about the ZODB-Dev mailing list