HHH-8869 fixes/simplifications for HikariCP 1.3.4

Conflicts:
	libraries.gradle
This commit is contained in:
Brett Meyer 2014-03-28 13:14:00 -04:00
parent 4a5bbc81c5
commit 5a7fd574da
3 changed files with 5 additions and 15 deletions

View File

@ -25,7 +25,6 @@ import java.util.Map;
import java.util.Properties;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.dialect.H2Dialect;
import com.zaxxer.hikari.HikariConfig;
@ -52,18 +51,10 @@ public class HikariConfigurationUtil {
copyProperty( AvailableSettings.ISOLATION, props, "transactionIsolation", hikariProps );
copyProperty( AvailableSettings.AUTOCOMMIT, props, "autoCommit", hikariProps );
if (props.containsKey( AvailableSettings.DIALECT )
&& props.get( AvailableSettings.DIALECT ).equals( H2Dialect.class.getName() )) {
// Terrible workaround for an issue with H2. The version of H2 we currently use does not include the
// standard DataSource#setUrl, but instead uses setURL. HikariCP's PropertyBeanSetter uses reflection and
// fails without this.
copyProperty( AvailableSettings.URL, props, "dataSource.URL", hikariProps );
}
else {
copyProperty( AvailableSettings.URL, props, "dataSource.url", hikariProps );
}
copyProperty( AvailableSettings.USER, props, "dataSource.user", hikariProps );
copyProperty( AvailableSettings.PASS, props, "dataSource.password", hikariProps );
copyProperty(AvailableSettings.DRIVER, props, "driverClassName", hikariProps);
copyProperty(AvailableSettings.URL, props, "jdbcUrl", hikariProps);
copyProperty( AvailableSettings.USER, props, "username", hikariProps );
copyProperty( AvailableSettings.PASS, props, "password", hikariProps );
for ( Object keyo : props.keySet() ) {
String key = (String) keyo;

View File

@ -29,7 +29,6 @@ hibernate.connection.username sa
hibernate.jdbc.batch_size 10
hibernate.connection.provider_class HikariCPConnectionProvider
hibernate.hikari.dataSourceClassName org.h2.jdbcx.JdbcDataSource
hibernate.hikari.poolName testPool
# Purposefully low and simplisitic.
hibernate.hikari.minimumPoolSize 2

View File

@ -113,7 +113,7 @@ ext {
c3p0: "com.mchange:c3p0:0.9.2.1",
ehcache: "net.sf.ehcache:ehcache:2.7.5",
proxool: "proxool:proxool:0.8.3"
hikaricp: "com.zaxxer:HikariCP:1.3.0"
hikaricp: "com.zaxxer:HikariCP:1.3.4"
]
}