开发者

Can I perform a transaction across two MySQL databases?

开发者 https://www.devze.com 2023-02-27 05:50 出处:网络
Can I do? Start transaction; insert into db1.table开发者_运维百科1 (field1) values (100),(100); insert into db2.table2 (field2) values (100),(100);

Can I do?

Start transaction;

insert into db1.table开发者_运维百科1 (field1) values (100),(100);

insert into db2.table2 (field2) values (100),(100);

commit;

Or will that not work?


Yes you can:

MySQL 5.0.3 and up provides server-side support for XA transactions. Currently, this support is available for the InnoDB storage engine. The MySQL XA implementation is based on the X/Open CAE document Distributed Transaction Processing: The XA Specification. This document is published by The Open Group and available at
http://www.opengroup.org/public/pubs/catalog/c193.htm. Ref: XA Transactions

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号