diff --git a/pom.xml b/pom.xml index e30ddd1..4f3cc66 100644 --- a/pom.xml +++ b/pom.xml @@ -73,6 +73,11 @@ 5.0.7.Final compile + + org.hibernate + hibernate-c3p0 + 5.0.7.Final + org.hsqldb hsqldb @@ -114,6 +119,11 @@ swingx-all 1.6.5-1 + + org.slf4j + slf4j-simple + 1.7.21 + diff --git a/src/main/java/musicplayer/db/HibernateDatabase.java b/src/main/java/musicplayer/db/HibernateDatabase.java index d5e2ef9..50a61b2 100644 --- a/src/main/java/musicplayer/db/HibernateDatabase.java +++ b/src/main/java/musicplayer/db/HibernateDatabase.java @@ -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");