Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

SQL-- what is a transaction? What are the characteristics of transactions?

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Concept

A Transaction is a program execution unit (unit) that accesses and possibly updates various data items in a database. Transactions are usually caused by the execution of user programs written in high-level database manipulation languages or programming languages such as SQL,C++ or Java, and are defined by statements such as begin transaction and end transaction (or function calls). A transaction consists of all operations performed between the start of the transaction (begin transaction) and the end of the transaction (end transaction).

For example, in a relational database, a transaction can be a SQL statement, a set of SQL statements, or an entire program.

Characteristics

Transaction is the basic unit of recovery and concurrency control.

Transactions should have four attributes: atomicity, consistency, isolation, and persistence. These four attributes are often referred to as ACID attributes.

Atomicity (atomicity). A transaction is an indivisible unit of work, and the operations included in the transaction are either done or not done.

Consistency (consistency). The transaction must change the database from one consistency state to another. Consistency is closely related to atomicity.

Isolation (isolation). The execution of one transaction cannot be interfered with by other transactions. That is, the operations and the data used within a transaction are isolated from other concurrent transactions, and the concurrent transactions can not interfere with each other.

Persistence (durability). Persistence, also known as permanence, means that once a transaction is committed, its changes to the data in the database should be permanent. Other operations or failures that follow should not affect it in any way.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report