Transaction Race Hunt

Find and fix check-then-act races in code that talks to a relational database. Name the anomaly first (lost update, write skew, check-then-insert phantom, double claim of work), establish the isolation level in force, then take the weakest fix that closes it: a constraint, one atomic conditional statement, an optimistic version column, SELECT FOR UPDATE in a global order with SKIP LOCKED for job claiming, or SERIALIZABLE with a retry on SQLSTATE 40001. Reproduce with a deterministic two-session interleaving, not a load test. Use whenever someone says "two requests booked the same seat", "balance went negative", "duplicate rows even though we check first" or "inventory oversold". Not for slow queries (sql-performance), general fault isolation (debugging), locks across processes (distributed-lock-audit), choosing constraints for a new model (schema-design), diagnosing a deadlock from the database log (deadlock-analysis).

greenblacked Updated
The twenty-nine plugins: coding, family, gamedev, operations, delivery, security, manager, personal, career, design, llm, data, techdocs, assurance, client-apps

File contents

greenblacked/AI commit d51c15f505

Frequently asked questions

npx get-skill add greenblacked/transaction-race-hunt