Hibernate_ using C3P0 Connection pool configuration

Source: Internet
Author: User

1. Introduction of the C3P0 jar package
2. Add a configuration in Hibernate's core configuration

<!--c3p0 Connection pool settings
-<!--use the C3PO connection pool  To configure the vendor that the connection pool provides-
<property name= Connection.provider_ Class >org.hibernate.connection.c3p0connectionprovider
</property>

<!--the minimum number of database connections available in the connection pool-
<property name= "c3p0.min_size" >5</property>
<!--the maximum number
of connections in a connection pool-- <property name= "C3p0.max_size" >20</property>
<!--set the expiration time of the database connection, in seconds,
If a database connection in the connection pool is idle for more than the timeout time, it is purged from the connection pool-
<property name= "C3p0.timeout" >120</property >
 <!--Check for idle connections in all connection pools in seconds--
<property name= "C3p0.idle_test_period" for every 3,000 seconds >3000</ Property>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.