1. Jar Package HIBERNATE-RELEASE-4.1.8.FINAL\LIB\OPTIONAL\C3P0
2. Join the configuration:
<!--database connection pool Maximum connections--
<property name= "C3p0.max_size" >30</property>
<!-- database connection pool minimum connections--
<property name= "C3p0.min_size" >2</property>
<!--How many database connections are acquired at the same time per request connection-
<property name= "C3p0.acquire_increment" >5</property>
<!--database connection pool When the connection object is not used for a long time, it should be destroyed--
<property name= "C3p0.timeout" >100</property>
<!--indicates how long the connection pool detection thread detects that all connections within a pool are timed out--
<property name= "C3p0.idle_test_period" >2000</property>
The connection pool itself does not remove itself from the connection pool, but rather has a thread that groups it at certain intervals.
This thread compares the time difference between the last time the connection object was used and the current one to timeout, and then decides to destroy the connection object.
<!-- The number of cache statement-
<property name= "C3p0.max_statements" >20</property>
Using the C3P0 data source in Hibernate