Database connectivity
The Spotfire Server database connection pool implementation is used for two things: connecting to the Spotfire database and connecting to JDBC compliant data sources through Information Services.
- The
driver-class
parameter contains the JDBC driver class name; see Database drivers and database connection URLs. - The
url
parameter contains the JDBC connection URL; see Database drivers and database connection URLs. - The
username
parameter contains the name of the database user to connect as, if applicable. - The
password
parameter contains the password for the specified database user, if applicable. The password is always encrypted and must therefore be set using the bootstrap command. It cannot be set manually. - The
min-connections
parameter contains the minimum number of allocated connections. - The
max-connections
parameter contains the maximum number of allocated connections. Depending on the pooling scheme, the total number of connections created by the server may be higher than the value of this parameter during high load, but all such extra connections will automatically be closed when the load decreases. By setting this parameter to zero or a negative value, connection pooling is effectively disabled and new connections will be continuously created as needed. - The
pooling-scheme
parameter defines the connection pooling algorithm to be used. There are two possible connection pooling algorithms that determine the way the connection pool operates, "DYNAMIC" and "WAIT". The "WAIT" algorithm is the default.When initialized, the connection pool creates a number of idle database connections equal to the
min-connections
parameter. When the connection pool receives a request for a database connection, it checks if the pool contains any idle connections and uses one of those, if available.- The "DYNAMIC" pooling scheme—If there are no idle connections in the pool, it automatically creates a new database connection. There is no upper limit for how many connections a connection pool can have open at the same time.
- The "WAIT" pooling scheme—If there are no idle connections in the pool and the number of already open connections is less than the
max-connections
parameter, it creates a new database connection.If the number of already open connections is equal to the
max-connections
parameter, it waits for an active connection to be returned to the pool. If the request cannot be fulfilled within a number of seconds equal to thelogin-timeout
parameter, the request times out. In the server logs entries similar to this appear, "Timeout while waiting for database connection after 10 seconds".Thus, in WAIT mode, the connection pool can never have more open (active or idle) connections than the value of the
max-connections
parameter. Whenever a database connection is returned, it is put in the pool of idle connections, unless it is used immediately to fulfill an already waiting request.
Idle connections in the database connection pool eventually time out if they are not used. The
connection-timeout
parameter defines how long (in seconds) a connection can remain idle in the connection pool before being closed and discarded.