MySQL Forums
Forum List  »  Connector/C++

Re: How do I get the session state (and then reconnect)?
Posted by: Luis Silva
Date: June 22, 2021 03:02AM


Yes, that is the correct way of using it.

mysqlx::Client will keep the connection, so first call to
mysqlx::Session session{ client }

will establish a new session, but next iterations will just get the already established connection. Unless, of course, some timeout occur and it fails to comunicate with the server.

Ah, forget to say, but you need to enable the Pooling in order for this to work as I documented above.
Please check for the ClientOption::POOLING and other timeout related options.

Options: ReplyQuote

Written By
Re: How do I get the session state (and then reconnect)?
June 22, 2021 03:02AM

Sorry, you can't reply to this topic. It has been closed.

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.