Comments - Migrating from MySql: MariaDB server closing client connections unexpectedly

9 years, 6 months ago Vladislav Vaintroub

you should not set global wait timeout, it will affect the timeout in the connection started after you current one.

Instead, you should set wait_timeout for your JDBC connection, with "set wait_timeout=57600"

You can test if this was correctly set with "select @@wait_timeout" (please, do this from the same connection). This is essential. If you change my.cnf, you need to restart the server

you need to set log_warnings=2, and look in your error log file. The path of the error log file is the value of the "log_error" variable.

9 years, 6 months ago Vivek Kubaji

We are using Hibernate so haven't come across any configuration to set wait_timeout for the connection. I'll check again. And for the moment it is ok to restart the DB as this is just the development environment.

9 years, 6 months ago Vladislav Vaintroub

Hibernate supports connection url. Connection url can have

"sessionVariables=wait_timeout=1000000" in the URL query string

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.