Re: Stale connection Issue in MySQL 8.0.26
Posted by: Filipe Silva
Date: October 20, 2021 05:46AM

> We are using MySQL Document store with below timeout configs. After few hours(< 8) of inactivity, jdbc client is unable to establish a connection with server. We had to reboot MySQL or Application server instance to make the connection pool active.

Are you properly releasing Session instances with close() once you are done with them?

> Is there any ways to keep the connection active such as Validation query or ping command in xdev jdbc connection string?

Not currently.

> How to set the query timeout /read time out from client side jdbc pool?

Note that you are using an X DevAPI pool, not a JDBC one.
The X DevAPI doesn't provide options to set the socket timeout, however, in Connector/J you can set it using the JDBC/global property

> How server side params mysqlx_connect_timeout and mysqlx_read_timeout works with client jdbc connection?

Both are server side settings and only affect how much time the server waits for something. As long as the client application doesn't set a socket timeout (see above) lower than any these values it should be fine, unless there are other networking issues of course.

Can you provide more details about how are you initializing and using the X DevAPI Client instance? Please also share the exception stack trace you getting.

Options: ReplyQuote

Written By
Re: Stale connection Issue in MySQL 8.0.26
October 20, 2021 05:46AM

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.