Connection to SQL Workbench/J gets disconnected frequently
Asked Answered
I

2

12

The connection to SQL Workbench/J gets disconnected very frequently. Where can I change the settings so that it does not lose the connections for atleast an hour.

Thanks

Inapproachable answered 9/3, 2016 at 20:59 Comment(0)
E
13

This works for me with using PostgreSQL...

  1. Go to Connection Window
  2. Select the connection you want to keep alive
  3. Click the "Connect scripts" button
  4. Write "Select 1" in the third box titled "Statement to keep connection alive"
  5. Write "1m" in fourth box titled "Idle time"

SQL Workbench/J (screenshot)

Educatory answered 5/10, 2016 at 23:11 Comment(3)
Just in case anyone sees this, for the iSeries DB2, use "VALUES 1" instead of "SELECT 1".Coincident
@Educatory a quick question. what do "select 1" and "1m" stand for in this case?Rameriz
On windows, the 'Connect scripts button' was hidden inside the connection window, after seeing your screenshot, I had resize the connection window, I was able to find the 'connect scripts' button. I had frequent problems with sqlworkbenchj UX (I cant find editor window sometimes) and google search always shows results for the other sqlworkbench.Burk
J
1

What OS are you using and what type of database are you connecting to?

I had the same issue using Windows connecting to a Redshift database. I followed the instructions on Amazon doing the following:

  • Edit (or otherwise create if not already existing in my case) the values for the following registry settings under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters:

    • KeepAliveTime: 30000
    • KeepAliveInterval: 1000
    • TcpMaxDataRetransmissions: 10

Reference here: http://docs.aws.amazon.com/redshift/latest/mgmt/connecting-firewall-guidance.html

Jochbed answered 6/2, 2017 at 23:40 Comment(1)
I'm on linux, using java.Hatfield

© 2022 - 2024 — McMap. All rights reserved.