{"id":"2pc-locks-released-on-both-paths","text":"Locks held by a transaction are released regardless of whether the transaction commits or aborts, preventing deadlocks across sequential transactions","truth_value":"IN","source":"entries/2026/05/29/two-phase-commit-test_2pc.md","source_url":"","source_hash":"","justifications":[],"dependents":[],"metadata":{"example":"def commit(self, tx_id):\n    for op in operations:\n        self.locks.pop(op[\"key\"], None)  # release on commit\ndef abort(self, tx_id):\n    if self.locks.get(op[\"key\"]) == tx_id:\n        del self.locks[op[\"key\"]]  # release on abort"},"explanation":{"steps":[{"node":"2pc-locks-released-on-both-paths","truth_value":"IN","reason":"premise"}]}}