Transaction Management in JavaEE-transaction Overview (1), javaee transactions

Source: Internet
Author: User

Transaction Management in JavaEE-transaction Overview (1), javaee transactions

Today, I want to talk about transaction management. Readers may or may not understand it. It is actually very simple (Please bypass it yourself ). I wanted to reference an idiom to describe the characteristics of transactions, but I did not find it suitable, so I found the following groups of idioms to describe transactions. In fact, the description of the transaction in the official document is also divided into four aspects. Here, I will explain it with my own understanding.

The first pair of words is: "Open the bow without looking back" and "Do your best? Success or failure ?)

The combination of these words seems to be the atomicity of transactions, that is, what we usually say is done, or nothing else. The previous steps show that the transaction has been successful. The subsequent steps are to roll back the transaction when the execution fails, that is, the transaction remains unchanged (refer to the following features-consistency ).

The second pair of words are: "Keep your mouth secure" and "look like a watch"

The combination of these terms is transaction consistency, which means that after a transaction ends, data will be valid and cannot be understood. In other words, this feature is a supplement to the previous feature. If you don't want to do it in half, I'm sorry you have to restore it to its original state. You can't change part of the data, and the other part has not changed.

The third pair of words is: "Nothing is too high to be suspended" and "sweep the snow in front of your own door, do not care about others on the cream"

The translation of these words into a white text is "taking care of me", which represents another feature of transactions-isolation. That is to say, there is no relationship between different transactions. After the transaction is committed, other transactions can see changes. Otherwise, external transactions are like a black box and do not know what they are doing.

The fourth pair of words is: "Dust settled" and "rice cooked mature rice"

This word means that everything has been done. Don't regret it. The features mapped to transactions are persistent. Once the transaction is completed, the changes made in the transaction will continue to be maintained. Of course, another transaction will be changed.

In the official documents, transactions that meet the preceding four features are called ACID transactions (A: atomicity, C: consistency, I: isolation, D: durability ). However, when meeting the ACID attribute, people will adopt flexible policies considering performance issues. For example, for the isolation level of data, people can set more relaxed or stricter regulations than before. (For details, refer to the Wikipedia entry "transaction isolation .) The rule is to improve performance or to obtain more consistent data.

Related Article

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.