A transaction does not jump straight from start to done; it passes through states that decide what the database must undo or keep after a failure. Knowing them explains why a crash after the last statement can still roll the work back. Use this model when reasoning about recovery or drawing the state diagram in a viva. Once committed, a transaction cannot be rolled back, so reversing it needs a new compensating transaction instead.