I am using 3 MySQL databases simultaneously. I need to insert 3 rows into 3 different databases.
Is it possible to use one transaction to accomplish this? If not, what would be an alternative method?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The databases are separate. You cannot use a transaction across them… that is impossible.
All you can do is perform 3 separate INSERTs.
Now, I suppose you could start a transaction on each, insert 3 rows, then end transaction on each, but this may not achieve your ultimate goal, depending on what it is.
Edit: I may stand corrected. See information here: http://dev.mysql.com/doc/refman/5.1/en/xa.html