GoLand 2023.2 Help

Manage connection sessions

In the Services tool window, you can view data sources, connection sessions, and session clients.

The Services tool window

In the picture above:

  1. Data source node.

  2. Disconnected session.

  3. Connected session.

  4. Session clients.

For information about the connection session managing options and toolbar controls, refer to Services tool window controls.

When you connect to a database server from the IDE, GoLand and the server establish a session to exchange information. The session is a wrapper that stores information about the connection (connected or disconnected), transaction control (automatic or manual), the DBMS_OUTPUT state for Oracle (enabled or disabled), and other settings.

A session has two states: connected and disconnected. When you run a query to a database or refresh an object state, the session connects. A small green circle indicates that communication between the IDE and a data source is active.

If you close GoLand and open it again, all your sessions will be available in the Services tool window, but they will be disconnected.

A session node may include a different number of session clients. A session client is any entity that needs to communicate with a database. It can be a query console; an SQL file; a table, a view or any other object opened in the data editor.

The following table includes basic actions that you can use to work with sessions.

Action

Description

Create a connection session to a data source

Click the <session> list and select New Session.

Create a connection session to a data source

Attach SQL file to an existing connection session

Click the <session> list and select an existing session.

Attach to an existing connection session

Detach a connection session

Click the <session_name> list and select an existing session.

Detach a connection session

Rename a connection session

In the Services tool window, right-click a session and select Rename Session.

Rename a connection session

Move a session or a data source to a separate tab

In the Services tool window, right-click a session or a data source and select Open in New Tab. To revert this action, close the separated tab.

Move a session or a data source to a separate tab

Close a connected session

In the Services tool window, right-click a session and select Close Session.

The session will be detached from its session clients, it will also disappear from the list.

Close all connection sessions

In the Services tool window, right-click a data source and select Close All Sessions.

Close all connection sessions

Configuring session options

Set a time zone for a session

  1. Open data source properties. You can open data source properties by using one of the following options:

    • In the Database tool window ( View | Tool Windows | Database) , click the Data Source Properties icon The Data Source Properties icon.

    • Press Control+Alt+Shift+S.

  2. Select a data source that you want to modify and click the Options tab.

  3. In the Time zone field, start typing the time zone that you want to use.

  4. Apply settings and click OK.

    Select a time zone in the Time zone field

Change a data source and a connection session

  1. Detach a file from the current connection session. To detach the file, click Detach Session from the Sessions list.

  2. From the list of dialects, select another dialect.

  3. From the Sessions list, select a connection session of this dialect.

Services tool window controls

For more information about the Services tool window, see the Services tool window topic.

Database services in the Services tool window

Left toolbar controls

Data sources

Icon

Action and shortcut

Description

The Jump to Console button

Jump to Query Console Control+Shift+F10

Open the Query Consoles popup. In the Query Consoles popup, you can select a query console that you want to open in the editor.

the Deactivate icon

Deactivate Control+F2

Close the database connection for the selected data source or data sources. (The data sources with connected sessions are indicated with a green dot in the corner of their icon.)

Sessions

Icon

Action and shortcut

Description

Tx

Transaction Mode

and

Transaction Isolation

Select the isolation level for database transactions and the way the transactions are committed.

  • Auto: the current transaction is committed automatically when you submit your local changes to the database server.

  • Manual: the changes submitted to the database server are accumulated in a transaction that can either be committed or rolled back explicitly by means of the Submit and Commit (the Submit and Commit icon) or Roll Back (the Roll Back button) buttons on the toolbar.

For more information about database transaction modes and isolation, refer to Submit changes to a database.

the Commit icon

Commit

Commit the current transaction. This button is available only for the manual transaction mode. See also, transaction mode and isolation.

the Roll back icon

Roll back

Roll back changes. This button is available only for the manual transaction mode. See also, transaction modes and isolation.

the Cancel Running Statements icon

Cancel Running Statements

Control+F2

Terminate execution of the current statement or statements.

the Restore Default Layout button

Restore Default Layout

Restore default positions of visual elements in the tool window.

Context menu

Data sources

Icon

Action and shortcut

Description

The Jump to Console button

Jump to Query Console Control+Shift+F10

Open the Query Consoles popup. In the Query Consoles popup, you can select a query console that you want to open in the editor.

the Deactivate icon

Deactivate Control+F2

Close the database connection for the selected data source or data sources. (The data sources with connected sessions are indicated with a green dot in the corner of their icon.)

Close All Sessions

Close all opened sessions to a data source.

Open in New Tab

Move the selected items to a separate tab.

Open Each in New Tab

Split the selected items into separate tabs.

Open Each Type in New Tab

Create separate tabs for each type of service.

Delete Delete

Close all opened sessions to a data source. Identical to Close All Sessions.

Sessions

Icon

Action and shortcut

Description

Tx

Transaction Mode

and

Transaction Isolation

Select the isolation level for database transactions and the way the transactions are committed.

  • Auto: the current transaction is committed automatically when you submit your local changes to the database server.

  • Manual: the changes submitted to the database server are accumulated in a transaction that can either be committed or rolled back explicitly by means of the Submit and Commit (the Submit and Commit icon) or Roll Back (the Roll Back button) buttons on the toolbar.

For more information about database transaction modes and isolation, refer to Submit changes to a database.

the Commit icon

Commit

Commit the current transaction. This button is available only for the manual transaction mode. See also, transaction mode and isolation.

the Roll back icon

Roll back

Roll back changes. This button is available only for the manual transaction mode. See also, transaction modes and isolation.

the Cancel Running Statements icon

Cancel Running Statements

Control+F2

Terminate execution of the current statement or statements.

the Restore Default Layout button

Restore Default Layout

Restore default positions of visual elements in the tool window.

Rename Session Shift+F6

Display the Rename Session '<session_name>' dialog where you can specify a name for a session.

Close Session

Close the selected session.

Open in New Tab

Move the selected items to a separate tab.

Open Each in New Tab

Split the selected items into separate tabs.

Open Each Type in New Tab

Create separate tabs for each type of service.

Delete Delete

Close all opened sessions to a data source. Identical to Close All Sessions.

SQL files

Icon

Action and shortcut

Description

Tx

Transaction Mode

and

Transaction Isolation

Select the isolation level for database transactions and the way the transactions are committed.

  • Auto: the current transaction is committed automatically when you submit your local changes to the database server.

  • Manual: the changes submitted to the database server are accumulated in a transaction that can either be committed or rolled back explicitly by means of the Submit and Commit (the Submit and Commit icon) or Roll Back (the Roll Back button) buttons on the toolbar.

For more information about database transaction modes and isolation, refer to Submit changes to a database.

the Commit icon

Commit

Commit the current transaction. This button is available only for the manual transaction mode. See also, transaction mode and isolation.

the Roll back icon

Roll back

Roll back changes. This button is available only for the manual transaction mode. See also, transaction modes and isolation.

the Cancel Running Statements icon

Cancel Running Statements

Control+F2

Terminate execution of the current statement or statements.

the Restore Default Layout button

Restore Default Layout

Restore default positions of visual elements in the tool window.

Attach Session

Attach the selected file to one of the available sessions. To detach the file from a session, open the file in the editor, click the <session> list and select Detach Session.

Open in New Tab

Move the selected items to a separate tab.

Open Each in New Tab

Split the selected items into separate tabs.

Open Each Type in New Tab

Create separate tabs for each type of service.

Delete Delete

Close all opened sessions to a data source. Identical to Close All Sessions.

the Jump to Source button

Jump to Source F4

Open the file in the editor.

Last modified: 21 August 2023