for_share() as well as for_update() addition to Model.QuerySet
|Reported by:||epandurski||Owned by:|
|Component:||Database layer (models, ORM)||Version:||1.0|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Ticket #2705 is a very good idea I think.
PostgreSQL supports SELECT ... FOR SHARE locking mode, which is basically
the same as FOR UPDATE mode but it does not conflicts with other transaction
having obtained FOR SHARE mode for the row.
It very useful if you need to be sure that your selected rows are not
modified since you have read them (which is true for almost every complex transaction).
I am not sure if MySQL has this feature but in PostgreSQL it first-class citizen so
I believe for_share() and for_update() has to be implemented together.
Change History (9)
comment:1 Changed 6 years ago by epandurski
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:2 follow-up: ↓ 7 Changed 6 years ago by mtredinnick
- Owner mir@… deleted
- Triage Stage changed from Unreviewed to Design decision needed