---
title: "How are sessions established from the SQL Toolkit to a database?"
description: "Sessions from the SQL Toolkit to a database are managed by connection pooling or disconnection settings. Adjusting the \"Close connection after query\" option controls connection reuse and helps manage session limits like Oracle's SESSION\\PER\\USER."
url: "https://docs.itrsgroup.com/docs/faq/geneos/115004027129-geneos-how-are-sessions-established-from-the-sql-toolkit-to-a-database/index.html"
---
**You can elect whether - on each sample - the SQL Toolkit keeps the connection, or disconnects after the sample.**

By default the SQL Toolkit will establish a connection using the credentials defined in the sampler setup. Having used this connection it will return it to a pool where it will be reused next time a connection with the same credentials is required. Externally this will appear as though the connection remains open between the probe and the database.  There is however a setting in the SQL Toolkit called "*Close connection after query*" which, by default, is set to *False*. When this option is set to *True*, Geneos attempts to close the existing connection via a "*disconnect*" database call every time a query is completed. No connection is reused or returned to the database connection pool, since a new connection is established (and consequently destroyed) after every query.

If you encounter the error "*Fail - ORA-02391: exceeded simultaneous SESSION\_PER\_USER limit(2391)*", this means that Geneos has no visibility over an Oracle database's SESSION\_PER\_USER limit. Geneos will either reuse an existing connection from the database connection or create a new one every time a query needs to be executed.  To solve this, ask the database administrator to increase the SESSION\_PER\_USER limit of the user profile.  For further details regarding the encountered error, see the links below:

- <http://stackoverflow.com/questions/8459593/ora-02391-exceeded-simultaneous-sessions-per-user-limit>


