Skip to content
Stefano Cristalli edited this page May 27, 2020 · 9 revisions

WARNING | Some user have experienced a problem after installing the extension: they lost edits (renamings and groups) they had made to their connections. This might happen to you also; you should backup your connections.xml before installing this extension. (see issue #19).

Building the extension (Linux)

  • If you are not interested in re-building the extension and only want to use it, please skip forward to section Setup.
  • Install the latest version of Oracle JDeveloper 12c.
  • Clone the repository.
  • Open "SQL Developer 4 keepalive.jws" with JDeveloper, upgrade its version if JDeveloper asks you to do so.
  • Build the project with the pre-loaded profile "JAR-Deploy", confirming the default options.
  • Launch the script "pack_extension.sh". The file keepalive.zip created by the script is the extension file that can be installed in SQLDeveloper.

Setup

  • Download this file: keepalive.zip (available in this repository under Releases).
  • Make sure that you have writing permissions on the installation folder of SQL Developer. To aquire them, launch this command (edit the path if necessary): sudo chmod -R o+w /opt/sqldeveloper.
  • Open SQL Developer.
  • From the Help menu select Check for Updates.
  • Install the extension from local file, choosing the keepalive.zip you have already downloaded.
  • SQL Developer should ask to restart, say yes.
  • On restart, you should see a new icon in the toolbar (next to the Save all button). To verify that this is the correct icon, put the mouse pointer over it (the tooltip "keepalive" should appear).

Use

  • The extension won't start automatically; a click on the icon is required to start it.

  • When the extension starts, the user has to input the desired timeout T in seconds. If by mistake the user does not insert a valid timeout (i.e. an integer greater than 59), T is set by default to 600.

  • Every T seconds, the query SELECT SYSDATE FROM DUAL; is sent on every open connection, in order to prevent it from closing.

  • To deactivate the keepalive extension, click the icon again.

Notes

  • The extension has a log system, which informs the user about successful operations or errors that have occurred. This log is shown is SQL Developper "Messages" window (sample below).
KEEPALIVE [11:29:39] INFO: Timeout set to 60 seconds.
KEEPALIVE [11:29:39] INFO: keepalive started.
KEEPALIVE [11:29:39] INFO: keepalive event triggered, scanning 11 connections...
KEEPALIVE [11:29:39] DEBUG: The keepalive query returned: 2018-08-13
KEEPALIVE [11:29:39] INFO: TEST_CONNECTION successfully kept alive!
KEEPALIVE [11:29:39] INFO: keepalive event finished, next event in 60 seconds.
  • WARNING | When the extension writes its log, the focus is gained by the log window in SQL Developer, and this might interfere with the autocomplete functionality if the user is writing a query. However, the extension is thought to be used with medium timeout settings (e.g. T=600), and we think that one click every ten minutes to bring back the focus to the active document is acceptable. FIXED IN RELEASE 1.2

Clone this wiki locally