19

It is not related to whatever version it is, just working to find out how to change (of course increase) session timeout value of Squirrel Sql Client. Because I really get bored of getting kind of exception "Last packet sent to the server was .. ago"

Any help would be appreciated.

Nakilon
  • 34,866
  • 14
  • 107
  • 142
javatar
  • 4,542
  • 14
  • 50
  • 67

5 Answers5

22

You can keep the connection alive by doing the following:

On Aliases->Modify the Selected Alias (pencil icon)-> Properties-> Connection (tab)

Check Enable Keep-Alive

and enter a simple query, in PostgreSQL I use SELECT 1;, in Oracle should be something like SELECT 1 FROM dual

user454322
  • 7,300
  • 5
  • 41
  • 52
  • At least for Oracle, [do **not** use a trailing semicolon `;`](http://stackoverflow.com/q/40179795/1529709)! – zb226 Oct 27 '16 at 08:10
8

Solution for MySQL:

  • Right-click a connection alias and select "Modify alias"
  • Click "Properties" and select the "Driver properties" tab
  • Set the property "autoReconnect" to "TRUE"
zb226
  • 9,586
  • 6
  • 49
  • 79
javatar
  • 4,542
  • 14
  • 50
  • 67
  • When I go to the Driver properties tab of my Alias's properties, I see one entry for remarksReporting. Do I need to somehow add an entry for autoReconnect? How? – Cincinnati Joe Oct 10 '11 at 12:46
  • I explain the answer in terms of MySQL connection. I mean, I am not sure whether you are using mysql or not and also not sure the reason for your case is because of this difference or not. – javatar Oct 10 '11 at 14:03
  • I'm using Oracle, not sure if that is the difference. – Cincinnati Joe Oct 10 '11 at 14:25
  • Instead or reconnecting you might want to keep the connection alive, there is an option to do that in the same window, see my answer below. – user454322 Mar 29 '12 at 08:29
  • @user454322 Thanks. However, I suppose the configurations such as connection timeout vs that be done in the sql server side should not let your connection keep itself alive. – javatar Mar 29 '12 at 08:34
  • I think that if the 'Sleep for' parameter is smaller than the timeout configured in the sql server your connection will keep alive. – user454322 Mar 29 '12 at 08:42
  • Yes, maybe, although it depends on the server configuration, still your idea worth trying. Thanks again. – javatar Mar 30 '12 at 06:27
1

I faced the same problem with my local development machine. Since using the driver property "autoReconnect" is discouraged by SQuirreL, I looked for another alternative which fixes the root cause.

Feature is discouraged.

I have access to the /etc/mysql/my.cnf directory on my Linux VM, so I could tweak the variable wait_timeout. Previously, it was set to 600 (600 / 60 seconds per minute = 10 minutes). I then set it to 28800 which is the MariaDB default.

After restarting the MySQL server using service mysql restart, everything worked like a charm!

Steffen Langer
  • 1,141
  • 1
  • 12
  • 16
0

If you're connecting to an Apache Derby db, use the following keep-alive test SQL:

VALUES 1
Unai Vivi
  • 3,073
  • 3
  • 30
  • 46
0

Locate the the prefs.xml in the installation directory and change the default loginTimeout value to your desired value and you are done.

double-beep
  • 5,031
  • 17
  • 33
  • 41
Uttam
  • 1