> You should also clear the session so the pending object is not
> flushed by run_with_transaction.
Did you mean, if I write some code as below, it should rollback
properly all the flushed data?
@expose(...)
def foo(self, tg_exceptions=None)
if tg_exceptions:
flush("Failed. All changes should have been rolled back")
session.clear() # as you suggested
.
.
.
@expose()
@exception_handler(foo)
def foo_save(self, **data):
.
save_data_part1(...)
session.flush()
call_a_method_which_might_raise_an_exception()
save_data_part2(...)
.
.
But as I observed, the data_part1 is getting saved even if an exception
is raised afterwards.
thanks
sanjay
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---