12-SQLite transactions and 12-sqlite transactions
I. Transaction Overview
A transaction is a series of operations performed as a single logical unit. Multiple operations are submitted to the system as a whole, either executed or not executed. transactions are an inseparable logical unit of work.
Ii. execution of transactions
Begin: Start transaction
Rollback: roll back the transaction
Commit: Submit a transaction
Note: what is "rollback transaction "?
Suppose 1: I now execute the begin, A, B, C, and rollback SQL statements in sequence. When A rollback transaction is encountered, it will return to the begin position again, that is to say, the statements A, B, and C do not work.
Suppose 2: I now execute the begin, A, B, C, and commit SQL statements in sequence. When A commit transaction is encountered, it will confirm that A, B, and C are executed.