Closed maslade closed 3 years ago
Yes, your understanding is correct. It is not the library doing it on purpose, but just how the MySQL protocol itself works. If you want them to run in parallel, you need a new connection per each chunk of queries you want to run in parallel.
Great - and thank you for the quick response.
Per the documentation:
If I understand this right, I can safely parallelize my requests to the database, but that the client will serialize them behind the scenes and I won't get any functional benefit from it.
To demonstrate what I'm asking for clarification on:
I'm trying to confirm that with this approach, while node will "parallelize" the work, each transaction would be executed in serial, with no possibility that the MySQL client would intersperse queries from invocation of
somethingTransactional()
call with those from another. Effectively the same as if I'd not usedPromise.all
but a sequence ofawait somethingTransactional();
calls.