Wednesday, May 22, 2013

Re: Understanding Django transactions

On May 21, 2013, at 12:43 PM, Aymeric Augustin wrote:
> Anyway, in this scenario, `atomic` will work as expected. When autocommit is off, you're always in a transaction, and as a consequence `atomic` uses savepoints to guarantee atomicity; it'll never commit. You have to call transaction.commit() at some point to save changes.

Just to clarify, `atomic` will commit in this scenario:

with atomic:
my_model_object.save()

You don't have to explicitly call transaction.commit() to issue a commit after the .save(), correct?

--
-- Christophe Pettus
xof@thebuild.com

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment