It will have beneficial performance effects if:
* `ATOMIC_REQUESTS` is not in use
* `update_or_create` ends up creating an object
* the `save` method of that objects does long things like sending email
after the write (i.e. once it holds an exclusive lock on the database)
--
Ticket URL: <https://code.djangoproject.com/ticket/25939>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"423b3afce431fd0a1d683bca9b2b80a1c4e3c8ca" 423b3afc]:
{{{
#!CommitTicketReference repository=""
revision="423b3afce431fd0a1d683bca9b2b80a1c4e3c8ca"
Fixed #25939 -- Removed redundant transaction in
QuerySet.update_or_create().
There is no need to wrap the save() call in transaction.atomic() as
it's already done down the call stack in Model.save_base().
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25939#comment:1>