The use of MySQL distributed transactions

Source: Internet
Author: User

Assume that you have a table on MySQL instance 1

CREATE TABLE person (    int,     varchar(+))

MySQL Instance 2 also has a same table, now from the person table in instance 1 to delete a piece of data and insert this data into the table of instance 2, both operations in the same transaction, because across the database instance, involves a distributed transaction.

MySQL implements a distributed transaction to see if the database is enabled for XA transactions:

 like ' Innodb_support_xa ';

MySQL commands for XA:

 ' A ' a ' a ' ;

The above command is a method of operation for a distributed transaction, and entering the above command on a command line is not a real distributed transaction. You can use JTA to control the xa of MySQL.

The example will be added later:

The use of MySQL distributed transactions

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.