Transactions
Wrapping code in a transaction does not make it safe. These posts are about what transactions actually guarantee, what isolation levels really mean, why @Transactional is not magic, and which race conditions survive even inside a SERIALIZABLE block.
The Long Transaction That Ate Your Postgres
An idle transaction pins the xmin horizon. Autovacuum cannot reclaim anything newer than it. Tables bloat. Queries slow. Here is the fix every install needs.
Read more BackendSagas Are Not Transactions
Sagas replace ACID transactions with compensation actions, not rollbacks. Intermediate states are visible to other services, and compensations can fail too.
Read more BackendTwo Transactions Walk Into a Lock
Deadlocks are not exotic. They are predictable consequences of lock order. Here are the patterns, the fixes, and the eleven characters that ended one outage.
Read more BackendDatabase Isolation Levels Are a Contract, Not a Dial
Isolation levels define which anomalies you tolerate, not how much correctness you get. The SQL standard and what databases implement diverged decades ago.
Read more Backend@Transactional Is Not Magic
@Transactional looks simple until you hit self-invocation, wrong exception types, or silent failures on private methods. Here's what it actually does.
Read more BackendTransactions Don't Fix Race Conditions
Wrapping code in a transaction doesn't make concurrent operations safe. Here's what transactions guarantee and what race conditions they let slip through.
Read more BackendDistributed Transactions Are a Lie
Why two-phase commit fails in production distributed systems, and what engineers actually use instead: sagas, the outbox pattern, and eventual consistency.
Read more Backend@Transactional Demystified: Every Attribute With Working Tests
Every @Transactional attribute explained with real working code: propagation, rollbackFor, readOnly, timeout, and isolation, each proved by a failing test.
Read more DatabaseOptimistic vs Pessimistic Locking in JPA
Two JPA strategies for preventing the lost update problem. @Version for optimistic locking, SELECT FOR UPDATE for pessimistic. Real SQL output, working tests.
Read more