MySQL Forums
Forum List  »  Connector/C++

Re: CDK Error: Reply blocked by a previous one.
Posted by: Rafal Somla
Date: March 12, 2020 11:17AM

So I have added some info about the root cause of this problem to the bug (https://bugs.mysql.com/bug.php?id=98827). Before we fix it, the error can be avoided if the result variable is made local, so that it is destroyed before next command is sent to the server. So change the original code like this:

auto res = mySession.sql("call abc.xyz();").execute();
int n = res.count();
auto res2 = mySession.sql("commit;").execute();

to something like this:

int n;
{
auto res = mySession.sql("call abc.xyz();").execute();
n = res.count();
}
auto res2 = mySession.sql("commit;").execute();

Options: ReplyQuote




Sorry, only registered users may post in this forum.

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.