Skip navigation links

MySQL Forums :: Quality Assurance :: XA transactions act like 2 common transactions


Advanced Search

XA transactions act like 2 common transactions
Posted by: Sergey Ryabenko ()
Date: March 19, 2012 05:57AM

Hi. I want to use XA transactions. Background: 2 mysql servers, PHP code which open XA transaction, end it, prepare and commit:

It work fine when all is fine.
But when i stop one server between PREPARE and COMMIT transactions become partically applied. On working server all changes are done, server wich was down has no changes and "xa recover" out empty set.
1> XA BEGIN 123
2> XA BEGIN 123
1> INSERT INTO some_table ....
2> INSERT INTO some_table ....
1> XA END 123
2> XA END 123
1> XA PREPARE 123
2> XA PREPARE 123
// Stop server 2
1> XA COMMIT 123
2> XA COMMIT 123 // ERROR: MySQL server has gone away

Server 1 containt row, server 2 does not.
You can find code here: http://pastebin.com/rkv9N7SQ

Options: ReplyQuote


Subject Views Written By Posted
XA transactions act like 2 common transactions 1576 Sergey Ryabenko 03/19/2012 05:57AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.