Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Devrim Gunyel
core
Commits
934c16dc
Commit
934c16dc
authored
May 22, 2019
by
Sascha Herzinger
Browse files
replaced C3P0 with Hikari
parent
27741bf3
Changes
4
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
934c16dc
...
...
@@ -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
1
5
:
0
0
:
00
+
0200
--
Sascha
Herzinger
<
sascha
.
herzinger
@
uni
.
lu
>
Wed
,
22
May
2019
1
0
:
3
0
:
00
+
0200
minerva
(
13.1.0
~
alpha
.0
)
unstable
;
urgency
=
low
*
Feature
:
annotators
are
more
flexible
-
you
can
define
set
of
input
and
...
...
persist/pom.xml
View file @
934c16dc
...
...
@@ -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>
...
...
persist/src/main/java/lcsb/mapviewer/persist/SpringPersistConfig.java
View file @
934c16dc
package
lcsb.mapviewer.persist
;
import
com.
mchange.v2.c3p0.ComboPooled
DataSource
;
import
com.
zaxxer.hikari.Hikari
DataSource
;
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
ComboPooled
DataSource
dataSource
(
ConfigurationHolder
config
)
throws
PropertyVetoException
{
ComboPooled
DataSource
dataSource
=
new
ComboPooled
DataSource
();
dataSource
.
setDriverClass
(
"org.postgresql.Driver"
);
public
Hikari
DataSource
dataSource
(
ConfigurationHolder
config
)
{
Hikari
DataSource
dataSource
=
new
Hikari
DataSource
();
dataSource
.
setDriverClass
Name
(
"org.postgresql.Driver"
);
dataSource
.
setJdbcUrl
(
config
.
getDbUri
());
dataSource
.
setUser
(
config
.
getDbUsername
());
dataSource
.
setUser
name
(
config
.
getDbUsername
());
dataSource
.
setPassword
(
config
.
getDbPassword
());
dataSource
.
set
MinPoolSize
(
5
);
dataSource
.
setMaxPoolSize
(
9
0
);
dataSource
.
set
MaxStatements
(
5
);
dataSource
.
set
IdleTimeout
(
30000
);
dataSource
.
setMax
imum
PoolSize
(
1
0
);
dataSource
.
set
ConnectionTestQuery
(
"select 1"
);
return
dataSource
;
}
...
...
pom.xml
View file @
934c16dc
...
...
@@ -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>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment