From 08eaa412f0af12601a6e1e9ac2d601fcc995d93c Mon Sep 17 00:00:00 2001 From: loic_lefevre Date: Thu, 24 Jul 2025 10:14:45 +0200 Subject: [PATCH] HHH-19644 - Enforce usage of SharedDriverManagerConnectionProviderImpl connection pool for hibernate-envers tests --- hibernate-envers/src/test/resources/hibernate.properties | 4 +++- .../hibernate/testing/jta/JtaAwareConnectionProviderImpl.java | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hibernate-envers/src/test/resources/hibernate.properties b/hibernate-envers/src/test/resources/hibernate.properties index e13c1cfc22f2..c90744fca4ac 100644 --- a/hibernate-envers/src/test/resources/hibernate.properties +++ b/hibernate-envers/src/test/resources/hibernate.properties @@ -8,8 +8,10 @@ hibernate.connection.url @jdbc.url@ hibernate.connection.username @jdbc.user@ hibernate.connection.password @jdbc.pass@ hibernate.connection.init_sql @connection.init_sql@ +hibernate.connection.autocommit false +hibernate.connection.initial_pool_size 0 -hibernate.connection.pool_size 2 +hibernate.connection.pool_size 5 hibernate.show_sql false diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/jta/JtaAwareConnectionProviderImpl.java b/hibernate-testing/src/main/java/org/hibernate/testing/jta/JtaAwareConnectionProviderImpl.java index 64b22a7b136a..6bda67839ce7 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/jta/JtaAwareConnectionProviderImpl.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/jta/JtaAwareConnectionProviderImpl.java @@ -62,6 +62,7 @@ import org.hibernate.service.spi.ServiceRegistryAwareService; import org.hibernate.service.spi.ServiceRegistryImplementor; import org.hibernate.service.spi.Stoppable; +import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProviderImpl; /** * A {@link ConnectionProvider} implementation intended for testing Hibernate/JTA interaction. In that limited scope we @@ -75,7 +76,7 @@ public class JtaAwareConnectionProviderImpl implements ConnectionProvider, Confi ServiceRegistryAwareService { private static final String CONNECTION_KEY = "_database_connection"; - private final DriverManagerConnectionProviderImpl delegate = new DriverManagerConnectionProviderImpl(); + private final DriverManagerConnectionProviderImpl delegate = SharedDriverManagerConnectionProviderImpl.getInstance(); private final List nonEnlistedConnections = new ArrayList<>();