Connection Time-Out

I love using this program...but with some of the latest updates, it seems my server connection timeout is insane. I find it incredibly annoying that by the time I tab out, copy over some SQL, tab back in and run it, my connection has already timed out. Then I have to re-run the query again.

[08S01] Communications link failure

The last packet successfully received from the server was 194,044 milliseconds ago.  The last packet sent successfully to the server was 7 milliseconds ago.
java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.

That's about 3 minutes.

Having autoReconnect set to true under my driver advanced tab doesn't seem to have any effect. Is there anything else I can do to rid myself of this warning every three minutes?

7 comments
Comment actions Permalink

Hello Ben,

What Database do you yse? Do you connect over ssh tunnel (related to this issue is https://youtrack.jetbrains.com/issue/DBE-432 ). Please also provide output information from Test Connection button for the Data Source and idea.log https://intellij-support.jetbrains.com/hc/en-us/articles/206827517 after issue happens.

0
Comment actions Permalink

I connect to my data sources with a standard TCP connection over port 3306.

Database: MySQL/5.1.61-log
Driver name: MySQL Connector Java
Driver version: mysql-connector-java-5.1.34 ( Revision: jess.balint@oracle.com-20141014163213-wqbwpf1ok2kvo1om )
JDBC version: 4.0
Case sensitivity: EXACT (quoted: EXACT)

Connection successful

10:27:59 AM [08S01] The last packet successfully received from the server was 9,737,827 milliseconds ago.  The last packet sent successfully to the server was 9,737,932 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
            java.net.SocketException: Software caused connection abort: socket write error
10:32:42 AM SELECT * FROM Users
10:32:42 AM [08S01] The last packet successfully received from the server was 10,025,146 milliseconds ago.  The last packet sent successfully to the server was 10,025,198 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
            java.net.SocketException: Software caused connection abort: socket write error

Nothing new shows in my idea.log when 0xDBE issues me the above warnings.

0
Comment actions Permalink

What result does  

show variables like 'wait_timeout';

query show? Have you tried to increase timeout for the server?

Using of autoReconnect option is not encoreged http://stackoverflow.com/a/667334/2000323 But anyway, it looks like it does not work in this case.

0
Comment actions Permalink

wait_timeout? DataGrip should be connecting as an interactive session. On my database (mysql) wait_timeout is 90 seconds but interactive_timeout is 28800 seconds.

Please see the mysql documentation:

https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_interactive_timeout
https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_wait_timeout

If DataGrip is connecting as a non-interactive session then that would explain the constant and extremely annoying timeout messages.

Edit: I just realized that you can set the interactiveClient flag within DataGrip. Setting it to true fixed my timeout issues. I'd suggest that it be true by default.

screenshot.png

Message was edited by: Brian Gordon

0
Comment actions Permalink

Thanks Brian, we will check if changing this driver default option will not do any harm and consider changing it.

0
Comment actions Permalink

I just downloaded DataGrid this week. I love PHPStorm and was excited about the possibility of having a database IDE built with the same approach to IDEs, but the connection timeout issue is seriously hampering my attempts to learn the application and determine if it's a realistic replacement for Navicat.

If I have an open connection, go edit some code, and come back a few minutes later it's pretty much guaranteed that I'm going to see this:

[08S01] Communications link failure The last packet successfully received from the server was 172,665 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago. java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.

 

I'm connecting to a MySQL database via SSH tunnel 

show variables like 'wait_timeout'; results in:

 

 

I tried Brian's suggestion of setting interactiveClient to true, but it doesn't seem to have had any impact.

1
Comment actions Permalink

Please Note, that your Database server should be on.

0

Please sign in to leave a comment.