Commit 934c16dc authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

replaced C3P0 with Hikari

parent 27741bf3
......@@ -2,9 +2,10 @@ minerva (14.0.0~alpha.0) unstable; urgency=low
* Feature: log4j is replaced with log4j2 logging mechanism (#291)
* Feature: database installed via debian package is done via dbconfig-commons
(#469)
* Feature: Replaced connection pool manager C3P0 with better maintained Hikari
* Feature removal: BioCompendium annotator removed (#32)
-- Piotr Gawron <piotr.gawron@uni.lu> Thu, 16 May 2019 15:00:00 +0200
-- Sascha Herzinger <sascha.herzinger@uni.lu> Wed, 22 May 2019 10:30:00 +0200
minerva (13.1.0~alpha.0) unstable; urgency=low
* Feature: annotators are more flexible - you can define set of input and
......
......@@ -158,15 +158,23 @@
<version>${postgresql-jdbc.version}</version>
</dependency>
<!--<dependency>-->
<!--<groupId>com.zaxxer</groupId>-->
<!--<artifactId>HikariCP</artifactId>-->
<!--<version>${hikari.version}</version>-->
<!--</dependency>-->
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>${c3p0.version}</version>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>${hikari.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4jVersion}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j-slf4jVersion}</version>
</dependency>
<dependency>
......
package lcsb.mapviewer.persist;
import com.mchange.v2.c3p0.ComboPooledDataSource;
import com.zaxxer.hikari.HikariDataSource;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Environment;
import org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy;
......@@ -15,7 +15,6 @@ import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.sql.DataSource;
import java.beans.PropertyVetoException;
import java.util.Properties;
@Configuration
......@@ -28,29 +27,16 @@ public class SpringPersistConfig {
return new ConfigurationHolder();
}
// @Bean
// public HikariDataSource dataSource(ConfigurationHolder config) {
// HikariDataSource dataSource = new HikariDataSource();
// dataSource.setDriverClassName("org.postgresql.Driver");
// dataSource.setJdbcUrl(config.getDbUri());
// dataSource.setUsername(config.getDbUsername());
// dataSource.setPassword(config.getDbPassword());
// dataSource.setIdleTimeout(30000);
// dataSource.setMaximumPoolSize(90);
// dataSource.setConnectionTestQuery("select 1");
// return dataSource;
// }
@Bean(destroyMethod = "close")
public ComboPooledDataSource dataSource(ConfigurationHolder config) throws PropertyVetoException {
ComboPooledDataSource dataSource = new ComboPooledDataSource();
dataSource.setDriverClass("org.postgresql.Driver");
public HikariDataSource dataSource(ConfigurationHolder config) {
HikariDataSource dataSource = new HikariDataSource();
dataSource.setDriverClassName("org.postgresql.Driver");
dataSource.setJdbcUrl(config.getDbUri());
dataSource.setUser(config.getDbUsername());
dataSource.setUsername(config.getDbUsername());
dataSource.setPassword(config.getDbPassword());
dataSource.setMinPoolSize(5);
dataSource.setMaxPoolSize(90);
dataSource.setMaxStatements(5);
dataSource.setIdleTimeout(30000);
dataSource.setMaximumPoolSize(10);
dataSource.setConnectionTestQuery("select 1");
return dataSource;
}
......
......@@ -69,8 +69,9 @@
<postgresql-jdbc.version>42.2.5</postgresql-jdbc.version>
<hikari.version>3.2.0</hikari.version>
<c3p0.version>0.9.1.2</c3p0.version>
<hikari.version>3.3.1</hikari.version>
<slf4jVersion>1.7.26</slf4jVersion>
<log4j-slf4jVersion>2.11.2</log4j-slf4jVersion>
<cglib.version>3.2.8</cglib.version>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment