django-transaction
Installation
SKILL.md
Django Transactions & Concurrency
Handle race conditions, locking, and transaction boundaries in Django.
Overview
Django provides robust transaction management to ensure data consistency:
- atomic - Transaction boundaries with rollback on error
- select_for_update - Row-level locking for concurrent access
- on_commit - Deferred callbacks after transaction commits
- update_or_create - Upserts with race condition handling
- M2M ordering - ManyToMany relationships require PK first