Do transactions make multiple requests? Is it possible to make just one request? #2096
Unanswered
KernelDeimos
asked this question in
Q&A
Replies: 1 comment 2 replies
-
There is no way of doing that, in mysql protocol you are only allowed to send next query after receiving results from a previous command. The only options for you are stored procedures ( if allowed by your server, for example Planetscale does not have SPs ) or sending multiple queries separated by ";" ( as you observed in #2097 you can't use prepared statements here but text protocol aka |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm dealing with mysql servers with a high round-trip latency. To deal with the situation I've created a class that mediates all write operations (insert, update, delete) so that they can be queued and sent to the mysql server in one go.
The trouble is, when I use a transaction I don't get the performance improvement I was hoping for. The data suggests that each operation in the transaction is being sent to the mysql server in a separate request.
Is mysql2 really making multiple separate requests in sequence? Is there a way to not do that?
Beta Was this translation helpful? Give feedback.
All reactions