Talk about one of the distributed transactions: What kind of transaction control does SOA need

Source: Internet
Author: User
Tags file system

In a distributed system based on SOA architecture, Services (service) become the basic function of providing units, regardless of the business process is not related to the basic functions, or specific business logic, are implemented in the corresponding services. Services to provide a unified interface, the use of standard communication between services to interact, each single service refined and effective combination, choreography into an organic whole. The implementation of an activity in such a distributed system often needs to cross the boundaries of a single service, and how to reconcile the relationships between multiple services to serve the implementation of the active function is an important topic of SOA: Service coordination. In particular, a distributed activity may execute for a few seconds, such as bank transfers, or a few minutes, hours, days, or more, such as immigration processing applications. Affairs, is undoubtedly the scope of the short run service collaboration (short-running Services coordination).

First, what is the transaction (Transaction)

A transaction provides a mechanism for incorporating all the operations involved in an activity into an indivisible unit of execution, and all operations that comprise a transaction can be committed only if all operations are performed correctly, as long as any of them fails to perform, causing the entire transaction to be rolled back. Simply put, a transaction provides a mechanism for either doing nothing or doing a full set (all or Nothing). A transaction has four properties, which, according to its first letter, are generally referred to as the acid four properties of the transaction:

* Atomicity (atomicity): The original meaning of the word "atom" is indivisible, the meaning of the atomic nature of a transaction is that all operations of a transaction are bundled into a whole, and all operations are executed or not executed;

* Consistency (consistence): The atomicity of a transaction ensures that a transaction does not break the consistency of the data, and if the transaction is committed successfully, the state of the data is the result of all operations that compose the transaction in a prearranged manner, and the data state is consistent; The entire transaction rolls back and reverts the data to its original state, and the data state is still consistent. Therefore, a transaction will only transition the data state from one consistency state to another consistent state;

* Isolation (Isolation): from the outside of the transaction, the consistency of the transaction enables the data to be transformed between two consistent states, but from within the transaction, the operations that comprise the transaction are executed in a logical order, so the data has an "intermediate state" in two consistent states. However, this intermediate state is isolated within the transaction and is not visible to the outside of the transaction;

* Persistence (Durability): persistence means that once a successful submission is made, data based on persistent resources (such as databases) is persisted and changes to the data are permanent.

The transaction originally originated from the Database management system (DBMS), reflecting the operation of the data stored in the database. In addition to the mainstream relational database management systems such as SQL Server,oracle and DB2 provide transactional support, transactional data manipulation can also be applied to other data storage resources, such as MSMQ. Since Windows Vista began to incorporate the file system (NTFS) to the registry into the category of transactional resources (transactional Resource).

Ii. explicit control of transactions

Although there are more and more family members of transactional resources, it is undeniable that the database is the most frequently used transactional resource. For developers with a bit of experience, Stored SQL should be written in a stored procedure (Procedure), or code based on a ado.net transaction is written, and the further introduction of the transaction is here.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.