Re: [sqlalchemy] Keeping soft deletion atomic in spite of model methods calling commit

2012-12-21 Thread Charles-Axel Dein
Thanks Michael. Always spot on. And I don't think I can find a more authoritative source ;) On Wed, Dec 19, 2012 at 5:48 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Dec 19, 2012, at 4:29 AM, charlax wrote: So the problem here is that the rollback does nothing, because there's a

[sqlalchemy] Keeping soft deletion atomic in spite of model methods calling commit

2012-12-19 Thread charlax
Hi, I'm trying to implement soft deletion in my app. I'd like to keep things atomic so that if an error happens during the soft deletion process, I don't get half deleted stuff. Here is a simplified view of my code (full working example here: https://gist.github.com/4329926): class

Re: [sqlalchemy] Keeping soft deletion atomic in spite of model methods calling commit

2012-12-19 Thread Michael Bayer
On Dec 19, 2012, at 4:29 AM, charlax wrote: So the problem here is that the rollback does nothing, because there's a commit in the delete_password method (in this example there's only method called, in reality I have multiple methods). I think having stuff being committed in a model's