SQL Please help

I have a repository server that runs fine locally on OSX 10.3.9 with the 3.18 sql driver and newest java.

I have a mysql server running on my box downtown and we connect to it through DSL.

If people are using the servoy clients everything runs fine. If the clients sit idle for more than a few minutes, when you go back in and try to access data from the mysql database, all clients freeze instantly and I have to restart the server.

I have tried different settings in my.cnf i have used diferent JDBC drivers for the database. Tried two way sockets on/off. everything i can think of. Anyone had thise problem or know of anything i can possibly try to keep the connection alive?

I have also tried to write a script that keeps the connection alive every minute but i can’t seem to find anything that will ping the database from servoy client. I tried to write a cron job to do it but i am having trouble.

Bo
Dealfirst

I tried it again. I am sitting and moving around through mysql records no problem. Have been doing it for the last housr or so. Works fine unless i let servoy sit for about 5 minutes.

If i let it sit with no activity then all clients freeze right when you try to load a record from mysql database.

my guess is that mysql server is dropping the connection if there is no activity for about 5 min. here is my my.cnf file. any help would be appreciated.

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
set-variable=wait_timeout=86400
set-variable=max_connections=125
set-variable=max_connect_errors=100
set-variable=connect_timeout=60

[mysql.server]
user=mysql
basedir=/var/lib
set-variable=wait_timeout=86400
set-variable=max_connections=125
set-variable=max_connect_errors=100
set-variable=connect_timeout=60

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
set-variable=mysql.allow_persistent=On
set-variable=max_connections=50
set-variable=wait_timeout=864000
set-variable=connect_timeout=86400

thanks

Bo
Dealfirst

I edited my my.cnf file to this and everything seems to be running perfectly. I used mysql administration program and it looked like once the connection hit a certain amount of time servoy was timing out and losing it. so if anyone else is having this problem this is how i fixed it. I’ve been pulling my hair out for 3 weeks on this one.

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
set-variable=wait_timeout=60
set-variable=max_connections=200
set-variable=max_connect_errors=100
set-variable=connect_timeout=60
set-variable=key_buffer_size=64M
set-variable=max_allowed_packet=32M
set-variable=table_cache=32M
set-variable=max_connections=200
set-variable=sort_buffer=8M

[mysql.server]
user=mysql
basedir=/var/lib
set-variable=wait_timeout=60
set-variable=max_connections=200
set-variable=max_connect_errors=100
set-variable=connect_timeout=60
set-variable=key_buffer_size=64M
set-variable=max_allowed_packet=32M
set-variable=table_cache=32M
set-variable=max_connections=600
set-variable=sort_buffer=8M

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
set-variable=mysql.allow_persistent=On
set-variable=max_connections=50
set-variable=wait_timeout=864000
set-variable=connect_timeout=86400

No connection timeouts are the best solution when connections are pooled on the server (like in servoy), another less efficient solution is specify a validation query for your database (servoy will check each time a connection is used if the server can be reached with it, before starting using it)