#transaction
Posts
-
Digging into Kafka's Source 12: Idempotence and Transactions — How Exactly-Once Is Built, and Wrapping Up the Series
We follow in the source what happens behind enable.idempotence=true and a transactional.id. Where the broker uses the producer id, epoch and sequence to spot duplicates from retries; how the transaction coordinator records state in __transaction_state and has commit/abort markers (control records) written to every partition; how a read_committed consumer filters with the last stable offset (LSO) and a list of aborted transactions; and how an old producer with the same transactional.id is fenced off by its epoch — checked with raw-socket, kafka-dump-log and kafka-transactions examples. As the last post, it also looks back over parts 1–12 to close the series.
-
Digging into MariaDB's Source 11: InnoDB Part 2 — Transactions, MVCC, Undo and Locks
We follow, in the source of the reference commit, how one COMMIT travels from the server layer's ha_commit_trans() to InnoDB's trx_t::commit(), how REPEATABLE READ shows you old values through a ReadView and the undo chain, how purge cleans up versions nobody can see any more, and how row locks, gap locks, lock waits and deadlock detection work. Two-session examples show the snapshot, a lock wait, a deadlock and the history list length with our own eyes.
-
Digging into Spring's Source 17: @Transactional — Who Opens a Transaction and Who Closes It
Put @Transactional on a method and somebody opens a transaction, rolls it back on an exception and commits it otherwise — this post follows who that somebody is, in the real source. The three interfaces PlatformTransactionManager, TransactionDefinition and TransactionStatus, the beans that @EnableTransactionManagement registers, the order in which TransactionInterceptor wraps a call, where propagation branches, why the connection is bound to a ThreadLocal, and traps such as "checked exceptions do not roll back" and "the outer method gets an UnexpectedRollbackException when the inner one fails", all checked with examples.