Transaction processing mechanism for Oracle and MySQL data

Source: Internet
Author: User
Tags savepoint

Compared to Oracle transaction processing, MYDQL is relatively simple, but the transaction as an important security mechanism in the database is essential, especially the inside of the transaction rollback mechanism is very useful, not to mention, first say the MySQL transaction processing:

MySQL Simple rollback:

First step: Start the transaction: starting transaction;

Step Two: Perform other change operations such as DML.

Step three: Roll to the previous state before starting the transaction: rollback;


This way, after execution, it is found that some of the previous operations have not been executed successfully. It is only after commit commits that the data is actually submitted. However, there are two things to consider, one is the service shutdown situation, so that our data rollback in the case of no commit is really going to execute, there is a rollback is able to use once, again use although not error, but do not play any role.

If you would say that I would like to implement multiple rollbacks in a transaction China, here you can use the set SavePoint:

In the second step above, you can do this: savepoint save point 1 (name only);

Then you continue to execute DML, to Nou a place to continue savepoint save point 2;

Do you want to scroll to the previous state by rollback to save the point. But, I have to tell you, want to think about and show the situation is not exactly the same, you will find only can roll to the first save point, the other save point will not exist!

Transaction Processing for Oracle:

Oracle does not have to explain open transactions, for DML statements, when you set the SavePoint, the next step is to return to the categorization malleability point on the same commit transaction with commit.


However, I have summed up an important principle here: transaction rollback can only reverse the direction of retrograde, the process has been irreversible. Unless you commit the end transaction.




Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Transaction processing mechanism for Oracle and MySQL 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.