Hi all
I have tried to configure hibernate to use DBCP connection pool but I get the following error and I am not sure what property of the dbcp I didn't set or didn't set correctly. The following si the dbcp properties I have set
hibernate.dbcp.initialSize=3
hibernate.dbcp.maxActive=100
hibernate.dbcp.maxIdle=8
hibernate.dbcp.minIdle=3
hibernate.dbcp.maxWait=5000
Code:
The error I get is:
net.sf.hibernate.HibernateException: Could not instantiate DBCP connection pool
at net.sf.hibernate.connection.DBCPConnectionProvider.configure(DBCPConnectionProvider.java:116)
at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:83)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:64)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1091)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:737)
at Main.test26(Main.java:175)
at Main.test2(Main.java:53)
at Main.main(Main.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
Caused by: java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:436)
at java.lang.Byte.parseByte(Byte.java:122)
at java.lang.Byte.parseByte(Byte.java:79)
at net.sf.hibernate.connection.DBCPConnectionProvider.configure(DBCPConnectionProvider.java:77)
... 12 more
By the way, what do you guys think about c3p0 connection pool? Is it robust and efficient? Please tell me if you have had encountered any difficult problems with c3p0 or any advices are very welcome!
Thanks !!