Added logging and connection pool providers.

This commit is contained in:
neviyn 2016-08-19 16:07:33 +01:00
parent dc8587ba75
commit 2d75adf6ac
2 changed files with 15 additions and 0 deletions

10
pom.xml
View File

@ -73,6 +73,11 @@
<version>5.0.7.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>5.0.7.Final</version>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
@ -114,6 +119,11 @@
<artifactId>swingx-all</artifactId>
<version>1.6.5-1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.21</version>
</dependency>
</dependencies>
<repositories>

View File

@ -41,6 +41,11 @@ public class HibernateDatabase implements IDatabase{
properties.put("hibernate.connection.driver_class", "org.hsqldb.jdbc.JDBCDriver");
properties.put("hibernate.enable_lazy_load_no_trans", "true");
properties.put("hibernate.c3p0.min_size", 5);
properties.put("hibernate.c3p0.max_size", 200);
properties.put("hibernate.c3p0.max_statements", 200);
properties.put("hibernate.c3p0.timeout", 0);
if(testMode){
properties.put("hibernate.connection.url", "jdbc:hsqldb:mem:.");
properties.put("hibernate.hbm2ddl.auto", "create-drop");