I have a Django project which uses a MySQL v5.5 backend with InnoDB storage.
To avoid race condition updates in DB, I'm using select_for_update to lock the rows.
Now if this lock stays for a long time, any queries on the locked rows will timeout.
I want to avoid this with one of the following options:
- Skip the rows which are locked, similar to
SKIP LOCKED
option. - Return immediately if some rows you're querying are locked, similar to
NOWAIT
option. - Reduce the lock wait timeout period for specific queries.
How do I perform any of these with Django ORM?