TransactionsTransactions

Transactions

BEGIN, COMMIT, ROLLBACK, and the isolation levels that decide what concurrent transactions see of each other.

Every INSERT, UPDATE, and DELETE on the previous pages ran as its own implicit transaction. This section covers doing it on purpose — grouping several statements so they succeed or fail together, and controlling what one transaction can see of another one running at the same time.

Playground note

The playground is one single-connection SQLite session, so it can't demonstrate two transactions running concurrently — that's what the isolation-levels page covers with static comparisons instead. What it can show live, and does: a BEGIN … COMMIT making changes permanent, and a BEGIN … ROLLBACK undoing them, against a scratch copy of a seed table so nothing else on the site is affected.

Want to experiment freely? The playground is the same SQLite engine, no guardrails.Open the playground →

On this page