Can I perform a transaction across two MySQL databases?

点点圈 提交于 2019-12-21 03:32:26

问题


Can I do?

Start transaction;

insert into db1.table1 (field1) values (100),(100);

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

commit;

Or will that not work?


回答1:


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



来源:https://stackoverflow.com/questions/5738685/can-i-perform-a-transaction-across-two-mysql-databases

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!