Re: [ZODB-Dev] Transaction undo example

2005-04-12 Thread Patrick DECAT
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 [EMAIL PROTECTED] 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@zope.org
 http://mail.zope.org/mailman/listinfo/zodb-dev

___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] Transaction undo example

2005-04-12 Thread Patrick DECAT
I believe you should then use the manage_undo_transactions method as
used in the undo.dtml form.

Something like:
context.manage_undo_transactions(transaction_info=('QTF5TVlhNjdtTXc9'))

HTH,
Patrick.

On Apr 12, 2005 2:09 PM, Stefan Milenkovic [EMAIL PROTECTED] wrote:
 Hello,
 
 Thank you for your answer! But my problem is not exactly this one. In
 fact I have a committed transaction and I want to undo it. It doesn't
 concern the current transaction...
 
 Maybe my first question was not clear...
 
 Thanks,
 
 Stefan
 
 
 On Apr 12, 2005 12:28 PM, Patrick DECAT [EMAIL PROTECTED] wrote:
  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 [EMAIL PROTECTED] 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@zope.org
   http://mail.zope.org/mailman/listinfo/zodb-dev
  
 

___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev