Database Connection Pool Parameters
This page lists and describes the connection pool parameters available to be used in codebeamer version 21.09 (EMMA), and in version 22.04 (FELICITY).
Only in codebeamer version 21.09 (EMMA)
These variables are not available from codebeamer 22.04 (FELICITY) release. In case the usage of these parameters is intended from version 22.04 (FELICITY), refer to the next section.
- CB_application_database_pool_max_active
Max active connection by application database pool. Default value: 35
- CB_application_database_pool_max_idle
Max idle connection by application database pool. Default value: 15
- CB_application_database_pool_min_idle
Min idle connection by application database pool. Default value: 10
- CB_quartz_database_pool_max_active
Max active connection by quartz database pool. Default value: 35
- CB_quartz_database_pool_max_idle
Max idle connection by quartz database pool. Default value: 15
- CB_quartzdatabase_pool_min_idle
Min idle connection by quartz database pool. Default value: 10
There is a known typo in "CB_quartzdatabase_pool_min_idle" which will be changed in the next version.
Connection timeout cannot be set via environment variable.
Since codebeamer version 22.04 (FELICITY)
HikariCP is introduced as a new type of connection pool making it possible to switch the pool type:
- CB_DATABASE_POOL_TYPE
- Valid values: TOMCAT or HIKARICP
- Default value is TOMCAT
All parameters supported by connection pool types are supported and can be set via environment variables.
The pattern to be used: CB_[database-provider]_pool_[parameter] or CB_[database-provider}_pool_quartz_[parameter]
- [database-provider] - the name of the database provider: tomcat or hikaricp
- [parameter] - the name of the parameter to be set
Example #1
Tomcat CP provides a parameter called 'maxActive'.
To set this parameter, the below environment variables can be used:
- CB_tomcat_pool_maxActive
- CB_tomcat_pool_quartz_maxActive
Example #2
HikariCP provides a parameter called 'maximumPoolSize'.
To set this parameter, the following environment variables can be used:
- CB_hikaricp_pool_maximumPoolSize
- CB_hikaricp_pool_quartz_maximumPoolSize
Connection pool specific parameters
See the connection pool specific parameters for Tomcat and HikariCP in the below sections.
Tomcat
For details on the Tomcat Connection Pool, see: https://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html#System_Properties
- Most common parameters:
- CB_tomcat_pool_maxActive
Max active connection by application database pool. Default value: 35
- CB_tomcat_pool_maxIdle
Max idle connection by application database pool. Default value: 15
- CB_tomcat_pool_minIdle
Min idle connection by application database pool. Default value: 10
- CB_tomcat_pool_quartz_maxActive
Max active connection by quartz database pool. Default value: 35
- CB_tomcat_pool_quartz_maxIdle
Max idle connection by quartz database pool. Default value: 15
- CB_tomcat_pool_quartz_minIdle
Min idle connection by quartz database pool. Default value: 10
- Quartz timeout
- CB_tomcat_pool_quartz_jdbcInterceptors=org.apache.tomcat.jdbc.pool.interceptor.QueryTimeoutInterceptor(queryTimeout=[timeoutInSec])
changes [timeoutInSec] to the desired value in seconds.
HikariCP
For more information on HikariCP configuration, see https://github.com/brettwooldridge/HikariCP#gear-configuration-knobs-baby.
- Most common parameters:
- CB_hikaricp_pool_minimumIdle
Min idle connection by application database pool. Default value: 35
- CB_hikaricp_pool_maximumPoolSize
Maximum size that the application database pool is allowed to reach, including both idle and in-use connections. Default value: 35
- CB_hikaricp_pool_quartz_minimumIdle
Min idle connection by quartz database pool. Default value: 35
- CB_hikaricp_pool_quartz_maximumPoolSize
Maximum size that the quartz database pool is allowed to reach, including both idle and in-use connections. Default value: 35
- Quartz timeout
- CB_hikaricp_pool_quartz_connectionTimeout=[timeoutInMs]
change [timeoutInMs] to the desired value in milliseconds.
Setting a parameter which is not supported by the type of connection pool chosen, the Data Source might fail to initialize.
Since codebeamer version 22.04-SP2 (FELICITY)
Timeout and Quartz Timeout can be configured separately. If Quartz Timeout is not configured, then Timeout is used.
A database configuration is considered correct or complete if the Driver and URL properties are not blank.
The priority is as follows:
- environment variables - if the configuration is correct, this will be used.
- configuration file - if the configuration is correct, this will be used.
If neither is correct, the install mode should run.
Examples configuring the same database
- environment variables
-DCB_database_JDBC_Driver=org.postgresql.Driver
-DCB_database_JDBC_ConnectionURL=jdbc:postgresql://localhost:5432/codebeamer_master
-DCB_database_JDBC_Username=user
-DCB_database_JDBC_Password=pass
-DCB_database_JDBC_Timeout=1000
-DCB_database_JDBC_Quartz_Timeout=2000
-DCB_database_JDBC_PasswordStorageType=ENCRYPTED
-DCB_DATABASE_POOL_TYPE=TOMCAT
- configuration file
database.driver=org.postgresql.Driver
database.connectionURL=jdbc:postgresql://localhost:5432/codebeamer_master
database.username=user
database.password=pass
database.timeout=5000
database.quartzTimeout=6000
database.connectionPoolType=TOMCAT
database.passwordStorageType=ENCRYPTED
See also: SQL Database Timeout