quick question. Is there a way to turn off transactions for a given python operation? Kapil
Let me a bit more specific. i'm developing a python product which does some fairly intensive list processing over a long list and adds stuff to the zodb based on that. If it bombs somewhere in the middle of the processing i don't want the whole transaction rolled back. i'm doing my own data integrity check so i want each add to be atomic independent of the transaction. i thought about sub-transactions to get around the enormous mem requirements of the huge transactions but it doesn't solve the problem of atomic adds. is there some way to either turn off transactions for a given python operation or to make an operation autocommit itself in a subtransaction? hmmm... related question (i think) how does one make a method whose effect can't be rolled back? any help appreciated Kapil Kapil Thangavelu wrote:
quick question.
Is there a way to turn off transactions for a given python operation?
Kapil
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi Kapil Thangavelu! I dont know of if this is what your after, but here is one way do do transacts with / without rollback One simple way of having rollback is to do it with except raising a flag, then if the flag gets turned on do whatever is needed to undo the current action this can be done recursivly, to rollback a whole sequence of actions rollback=0 try: [do stuff foo] try: [do stuff bar] except: rollback=1 if rollback: [rollback bar] except: rollback=1 if rollback: [rollback foo]
hmmm... related question (i think) how does one make a method whose effect can't be rolled back?
try: [do stuff foo] [do stuff bar] except: pass /Jacob Lundqvist
participants (2)
-
Jacob Lundqvist -
Kapil Thangavelu