Add provider_class property to cfg template

This commit is contained in:
Yevhen Ivantsov 2023-05-08 07:41:14 +10:00
parent a9ea878fdb
commit 6a2c0a8d72
3 changed files with 6 additions and 1 deletions

View File

@ -238,6 +238,7 @@ optional.
* `ATL_DB_VALIDATE` (default: false) * `ATL_DB_VALIDATE` (default: false)
* `ATL_DB_ACQUIREINCREMENT` (default: 1) * `ATL_DB_ACQUIREINCREMENT` (default: 1)
* `ATL_DB_VALIDATIONQUERY` (default: "select 1") * `ATL_DB_VALIDATIONQUERY` (default: "select 1")
* `ATL_DB_PROVIDER_CLASS` (default: `com.atlassian.confluence.impl.hibernate.DelegatingHikariConnectionProvider`)
## Data Center configuration ## Data Center configuration

View File

@ -45,6 +45,7 @@
<property name="hibernate.hikari.maximumPoolSize">{{ atl_db_poolmaxsize | default('100') }}</property> <property name="hibernate.hikari.maximumPoolSize">{{ atl_db_poolmaxsize | default('100') }}</property>
<property name="hibernate.hikari.minimumIdle">{{ atl_db_poolminsize | default('20') }}</property> <property name="hibernate.hikari.minimumIdle">{{ atl_db_poolminsize | default('20') }}</property>
<property name="hibernate.hikari.registerMbeans">true</property> <property name="hibernate.hikari.registerMbeans">true</property>
<property name="hibernate.connection.provider_class">{{ atl_db_provider_class | default('com.atlassian.confluence.impl.hibernate.DelegatingHikariConnectionProvider') }}</property>
{% endif %} {% endif %}
{% endif %} {% endif %}

View File

@ -284,7 +284,7 @@ def test_confluence_xml_postgres(docker_cli, image, run_user):
assert xml.findall('.//property[@name="hibernate.hikari.maximumPoolSize"]')[0].text == "100" assert xml.findall('.//property[@name="hibernate.hikari.maximumPoolSize"]')[0].text == "100"
assert xml.findall('.//property[@name="hibernate.hikari.minimumIdle"]')[0].text == "20" assert xml.findall('.//property[@name="hibernate.hikari.minimumIdle"]')[0].text == "20"
assert xml.findall('.//property[@name="hibernate.hikari.registerMbeans"]')[0].text == "true" assert xml.findall('.//property[@name="hibernate.hikari.registerMbeans"]')[0].text == "true"
assert xml.findall('.//property[@name="hibernate.connection.provider_class"]')[0].text == "com.atlassian.confluence.impl.hibernate.DelegatingHikariConnectionProvider"
def test_confluence_xml_postgres_all_set(docker_cli, image, run_user): def test_confluence_xml_postgres_all_set(docker_cli, image, run_user):
environment = { environment = {
@ -295,6 +295,7 @@ def test_confluence_xml_postgres_all_set(docker_cli, image, run_user):
'ATL_DB_POOLMAXSIZE': 'x100', 'ATL_DB_POOLMAXSIZE': 'x100',
'ATL_DB_POOLMINSIZE': 'x20', 'ATL_DB_POOLMINSIZE': 'x20',
'ATL_DB_TIMEOUT': '40', 'ATL_DB_TIMEOUT': '40',
'ATL_DB_PROVIDER_CLASS': 'com.example.class',
} }
container = run_image(docker_cli, image, user=run_user, environment=environment) container = run_image(docker_cli, image, user=run_user, environment=environment)
_jvm = wait_for_proc(container, get_bootstrap_proc(container)) _jvm = wait_for_proc(container, get_bootstrap_proc(container))
@ -305,6 +306,7 @@ def test_confluence_xml_postgres_all_set(docker_cli, image, run_user):
assert xml.findall('.//property[@name="hibernate.hikari.idleTimeout"]')[0].text == "40000" assert xml.findall('.//property[@name="hibernate.hikari.idleTimeout"]')[0].text == "40000"
assert xml.findall('.//property[@name="hibernate.hikari.maximumPoolSize"]')[0].text == "x100" assert xml.findall('.//property[@name="hibernate.hikari.maximumPoolSize"]')[0].text == "x100"
assert xml.findall('.//property[@name="hibernate.hikari.minimumIdle"]')[0].text == "x20" assert xml.findall('.//property[@name="hibernate.hikari.minimumIdle"]')[0].text == "x20"
assert xml.findall('.//property[@name="hibernate.connection.provider_class"]')[0].text == "com.example.class"
@ -553,6 +555,7 @@ expected_db_properties = {
'hibernate.hikari.registerMbeans': 'true', 'hibernate.hikari.registerMbeans': 'true',
'hibernate.hikari.maximumPoolSize': '100', 'hibernate.hikari.maximumPoolSize': '100',
'hibernate.hikari.minimumIdle': '20', 'hibernate.hikari.minimumIdle': '20',
'hibernate.connection.provider_class': 'com.atlassian.confluence.impl.hibernate.DelegatingHikariConnectionProvider',
}, },
'c3p0': { 'c3p0': {
'hibernate.c3p0.min_size': '20', 'hibernate.c3p0.min_size': '20',