core-jgi/org.adempiere.base
Jasper Siepkes 861e3ad01f
IDEMPIERE-5013 Implement HikariCP as a replacement for c3p0 (#926)
* Replaced PostgreSQL and Oracle connection pools with HikariCP.

Replaced C3P0 with HikariCP. HikariCP is a Apache licensed connection pool with substantially better performance and better resilience to failure (DB disconnects, etc.) then C3P0. Read more about it here: https://github.com/brettwooldridge/HikariCP .

Cleaned up the `getCachedConnection` method. With HikariCP there is no need to retry to obtain a connection since getting an connection will block until a free connection is available or until a timeout is reached (default 30 seconds) at which point an `SQLException` is thrown. This also removed calling `Runtime.getRuntime().runFinalization();`. HikariCP is currently configured to detect / log leaks when a connection hasn't returned to the pool for longer then 5 minutes.

Loading of pool config properties was cleaned up. Defaults are now loaded from a single file instead of defaults coming from both file and hardcoded properties. It is now also possible to specify any HikariCP property in the user pool property file.

Initialization of the datasource must happen in the `getDataSource()` method because at object construction not all JDBC config is known. However this method could (as far as I could tell) be called concurrently from multiple threads but had no mechanism to prevent initializing the DB pool multiple times. The variable in which the pool itself was stored (`m_ds`) also was not marked volatile or immutable which could lead to visibility issues. Instead of lazy initialization of the pool in the `getDataSource()` method the pool could probably better be initialized at object construction. However I wasn't able to achieve that without breakage therefor I made the initialization mechanism work correctly with concurrent invocations.

Various config options such as the `MaxStatementsPerConnection` options were removed because HikariCP doesn't support them.

* (Re)added Sequence time-out.
2022-09-10 12:21:57 +02:00
..
.settings IDEMPIERE-4842 Easier model registration (#893) 2021-09-22 22:42:51 +08:00
META-INF IDEMPIERE-5361 : Jasper reports with Charts are not working (#1452) 2022-08-26 09:35:54 +08:00
OSGI-INF IDEMPIERE-5056 Order and Invoice: Tax lookup interface (#1253) 2022-03-23 15:00:08 +01:00
antlr IDEMPIERE-5367 Logic expression IN doesn't works with quoted text (#1423) 2022-08-05 13:21:50 +02:00
schema
src IDEMPIERE-5013 Implement HikariCP as a replacement for c3p0 (#926) 2022-09-10 12:21:57 +02:00
.packaging
.project IDEMPIERE-4933 Platform update for 9.x (#870) 2021-09-10 09:55:07 +02:00
build.properties IDEMPIERE-5225 - HTML Report minification (#1237) 2022-03-17 15:36:02 +01:00
documentation.bat
packaging-build.xml
plugin.xml IDEMPIERE-5015 add org.adempiere.base.annotation.Callout annotation (#948) 2021-10-27 12:15:58 +02:00
pom.xml IDEMPIERE-5225 - HTML Report minification (#1237) 2022-03-17 15:36:02 +01:00