Changes between Version 12 and Version 14 of Ticket #28344


Ignore:
Timestamp:
09/19/2018 05:26:18 AM (2 years ago)
Author:
Jure Erznožnik
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28344 – Description

    v12 v14  
     1I have a project where we deal with many financial operations that rely on transactions and row-level locking a lot to guard against race conditions. Unfortunately it's a common pattern for a function to accept an instance of model A, start an atomic block, fetch a new instance of the same row with `select_for_update()`, do a change, call `save()` and then refresh the original instance. It would all be easier if I could just call `instance.refresh_from_db(for_update=True)` and it would save a me a DB roundtrip to refresh the original instance passed (Django ORM does not have a session manager so the old object will not otherwise reflect the changes).
Back to Top