~~NOTRANS~~
~~Title: Connection Pooling~~
Our [[https://www.sibvisions.com/files/jvx/current/api/com/sibvisions/rad/persist/jdbc/DBAccess.html|DBAccess]] supports a simple configurable connection pool with [[https://www.sibvisions.com/files/jvx/current/api/com/sibvisions/rad/persist/jdbc/ConnectionPoolProvider.html|ConnectionPoolProvider]].
The ConnectionPoolProvider creates a default DataSource and an [[https://www.sibvisions.com/files/jvx/current/api/com/sibvisions/rad/persist/jdbc/IConnectionPool.html|IConnectionPool]].
We currently use [[https://github.com/brettwooldridge/HikariCP|Hikari]] and [[https://tomcat.apache.org/tomcat-9.0-doc/jdbc-pool.html|Tomcat]] for our connection pool implementation. With Hikari we have an independent solution and Tomcat will only work on Tomcat application servers.
== Configuration ==
The connection pool can be enabled by simply calling ''setConnectionPoolEnabled(true)'' on DBAccess, or it can be enabled in [[jvx:common:setup:dbindependent_config|config.xml]].
Example:
...
...
We support different use-cases:
- Implementing getDataSource() in application life cycle object (Application.java)
- Configure specific IDataSourceCreator in config.xml, e.g.\\
com.sibvisions.rad.persist.jdbc.datasource.TomcatDataSourceCreator
- Configure ServiceLoader for IDataSourceCreator
- Register custom IDataSourceCreator in ConnectionPoolProvider, e.g. ''ConnectionPoolProvider.registerDataSourceCreator(CustomDataSourceCreator.class);'' \\ There are 2 IDataSourceCreator registered by default:\\ * HikariDataSourceCreator\\ * TomcatDataSourceCreator
The default implementations of IDataSourceCreator supports several parameter by default.
The following example config.xml shows all supported parameters.
...
...