Search CTRL + K

Transaction

在数据库领域,事务 是指在 数据库管理系统 中将一系列操作合并执行,保证这一些操作要么都成功提交,要么都失败回滚。事务 之间相互独立无影响。

事务 有两个作用:

事务 ACID 特性

一致性状态

指数据库中的数据满足完整性约束条件


Wikipedia

A database transaction symbolizes a unit of work, performed within a database management system (or similar system) against a database, that is treated in a coherent and reliable way independent of other transactions.[1]

  1. To provide reliable units of work that allow correct recovery from failures and keep a database consistent even in cases of system failure. For example: when execution prematurely and unexpectedly stops (completely or partially) in which case many operations upon a database remain uncompleted, with unclear status.
  2. To provide isolation between programs accessing a database concurrently. If this isolation is not provided, the programs' outcomes are possibly erroneous.

  1. https://en.wikipedia.org/wiki/Database_transaction ↩︎