Hi:
I am using the hibernate-search 3.2.1,everything went well until this morning.
Since my application is now to be tested,so the app was started yesterday afternoon,it works well at first. But when I check it this morning,I got some exceptions:
Quote:
org.hibernate.exception.JDBCConnectionException:could not execute query.
caused by :com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:communications link failure
The last packet successfully reveived from the server was 76279756 milliseconds ago.
After googling it,it is said that this is caused by the mysql connection pool.(the connection has been closed when it is checked out from the pool).
And in my hibernate.cfg.xml,I intended to use the c3p0,so this is the fragment:
Code:
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">1800</property>
<property name="hibernate.c3p0.max_statements">50</property>
But I am surprised when I check the hibernate-core-3.5.4.jar,there is no "C3P0ConnectionProvider" under the package:"org.hibernate.connection", also,in the log of my application,I have not found any c3p0 words.so I am confused:
1> Does the hibernate-search support connection pool? If so,is it mean I have add the ConnectionProvider manually?
2> If support,how to config the c3p0?
I know the basic config(in the above exmaple),but how about if I want to add some other c3p0 config properties? In my requirement,I need the following two properties:
Code:
c3p0.testConnectionsOnCheckIn=ture //validate the connection when check in
c3p0.idleConnectionTestPeriod=3600 // check every 1 hour.