|< < 28 > >|

Transactions

The mechanism for making actions indivisible is a transaction.

A transaction is created by placing actions (queries, updates) inside transaction boundaries.

  • SQL guarantees that a single statement is executed as a transaction.

  • If multiple statements need to be done indivisibly, specify transaction boundaries.

  • Surrounding a single statement by transaction boundaries is harmless.

Transaction boundaries

  • To start a transaction: begin
  • To commit the updates from a transaction: commit
  • To discard the updates from a transaction: rollback

|< < 28 > >|