Django Pessimistic Locking (悲觀鎖定)

when select task by id, the database lock the record. if other one to do same time the second one will get the “Task is already claimed or completed”

We use transaction.atomic() as a context manager to ensure that all database operations within the block are atomic, meaning they are either all committed or all rolled back in case of an error.

分類: Django,標籤: 。這篇內容的永久連結


發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *