Database transaction ACID

简介:
Database transaction ACID

1. In database systems,  atomicity  (or atomicness) is one of the ACID transaction properties. In an atomic transaction, a series of database operations  either all occur, or nothing occurs .

An example of atomicity is ordering an airline ticket where two actions are required: payment, and a seat reservation. The potential passenger must either:
  1. both pay for and reserve a seat; OR
  2. neither pay for nor reserve a seat.
The booking system does not consider it acceptable for a customer to pay for a ticket without securing the seat, nor to reserve the seat without payment succeeding.


2. In database systems, a  consistent  transaction is one that  does not violate any integrity constraints during its execution .  

    * Entity integrity
    * Referential Integrity
    * Domain Integrity

For example, if you define the attribute of Age of an Employee entity, as an integer, the value of every instance of that attribute must always be numeric and an integer.
If you also define that this attribute must always be positive, then a negative value is forbidden.


3. In database systems,  isolation  is a property that defines  how/when the changes made by one operation become visible to other concurrent operations

The isolation property is the most often relaxed ACID property in a DBMS (Database Management System). This is because to maintain the highest level of isolation a DBMS usually acquires locks on data, which may result in a loss of concurrency, or else implement multiversion concurrency control, which may require additional application logic to function correctly.

Most DBMSs offer a number of transaction isolation levels which control the degree of locking which occurs when selecting data. For many database applications the majority of database transactions can be constructed in such a way as to not require high isolation levels, thus reducing the locking overhead for the system. The programmer must carefully analyze database access code to ensure that any relaxation of isolation does not cause difficult-to-find software bugs. Conversely, at higher isolation levels the possibility of deadlock is increased, which also requires careful analysis and programming techniques to avoid.

4. In database systems,  durability  is the ACID property which  guarantees that transactions that have committed will survive permanently . For example, if a flight booking reports that a seat has successfully been booked, then the seat will remain booked even if the system crashes.
Durability can be achieved by flushing the transaction's log records to non-volatile storage before acknowledging commitment. In distributed transactions, all participating servers must coordinate before commit can be acknowledged. This is usually done by a two-phase commit protocol.



links:
http://en.wikipedia.org/wiki/Atomicity_%28database_systems%29
http://en.wikipedia.org/wiki/Consistency_%28database_systems%29
http://en.wikipedia.org/wiki/Isolation_%28database_systems%29
http://en.wikipedia.org/wiki/Durability_%28database_systems%29









本文转自 h2appy  51CTO博客,原文链接:http://blog.51cto.com/h2appy/208595,如需转载请自行联系原作者
目录
相关文章
【Unity3D 问题总结】Unity报错提示:Asset database transaction committed twice
也找不到代码哪里出错了,新建查空场景运行也会报错,真是离了个大谱! 然后打开UnityHub发现原来是许可证过期了!!
【Unity3D 问题总结】Unity报错提示:Asset database transaction committed twice
|
数据库
Exception: The transaction log for database is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc.错误解决
升级数据库到最后一步,X,遇错。 还好,是定位数据库错误,以前怕LOG日志变大,作了限制。 取消即可。 顺便列几条要用的命令:   New-SPWebApplication -Name "Helios80" -ApplicationPool "helios80AppPool" -Aut...
1319 0
|
6月前
|
SQL Oracle 关系型数据库
WARNING: Too Many Parse Errors With error=911 When Running a JDBC Application Connected to an Oracle 19c database
WARNING: Too Many Parse Errors With error=911 When Running a JDBC Application Connected to an Oracle 19c database (
88 2
|
6月前
|
Oracle 关系型数据库
19c 开启Oracle Database Vault
19c 开启Oracle Database Vault
161 1
|
6月前
|
SQL Oracle 关系型数据库
Connect to Autonomous Database Using Oracle Database Tools
Connect to Autonomous Database Using Oracle Database Tools
60 1
|
5月前
|
Oracle 关系型数据库 Linux
Requirements for Installing Oracle Database/Client 19c on OL8 or RHEL8 64-bit (x86-64) (Doc ID 2668780.1)
Requirements for Installing Oracle Database/Client 19c on OL8 or RHEL8 64-bit (x86-64) (Doc ID 2668780.1)
45 0
下一篇
无影云桌面