Re: Managing transactions using multiple databases

2013-07-08 Thread Leandro Boscariol
Amazing work Christophe, congrats! Lot's of new cool stuff being added to 1.6, looking forward to it. Regarding the nested xact context managers, let's say something that I don't like happened and I want to abort everything: with xact(using=db1): with xact(using=db2): obj1 = Ob1.save(

Re: Managing transactions using multiple databases

2013-07-06 Thread Christophe Pettus
On Jul 6, 2013, at 8:58 PM, Leandro Boscariol wrote: > And also thanks for mentioning xact, I wasn't aware of that! Full disclosure: I wrote it. :) In 1.6, the new atomic() decorator / context manager is the way to go, but xact() works fine for now! -- -- Christophe Pettus x...@thebuild.com

Re: Managing transactions using multiple databases

2013-07-06 Thread Leandro Boscariol
Well, even though without true two-phase commit, for now that will do, thanks. And also thanks for mentioning xact, I wasn't aware of that! Cheers, Leandro On Saturday, July 6, 2013 10:41:11 AM UTC-3, Christophe Pettus wrote: > > > On Jul 6, 2013, at 2:54 PM, Leandro Boscariol wrote: > > > How

Re: Managing transactions using multiple databases

2013-07-06 Thread Christophe Pettus
On Jul 6, 2013, at 2:54 PM, Leandro Boscariol wrote: > How can I do a transaction management in both databases at the same time? Is > that even possible? You can certainly nest the transaction context managers (atomic() in 1.6+, or you can use xact() in 1.5 and earlier): with xact(using=DA

Managing transactions using multiple databases

2013-07-06 Thread Leandro Boscariol
Hello, During the design of a project, I came across a situation where I will have 2 databases. Not a big deal, it is very well documented in Django docs . Dealing with transactions