"will a mysql transaction work if multiple connections are used for the queries?" Code Answer

2

all queries inside of a transaction must be on the same connection. if you have three connections, you have three transactions open (assuming they're not in autocommit mode).

if you actually need distributed transactions, you'll have to use mysql's xa transactions—but that should only really be required if you're dealing with transactions in more than one database (or, alternatively, some other non-database transactions).

By kinsho on January 28 2022

Answers related to “will a mysql transaction work if multiple connections are used for the queries?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.