Hibernate configures Proxool to connect Oracle11g

Source: Internet
Author: User
Tags web database
Hibernate supports third-party connection pools. the officially recommended connection pools are C3P0, Proxool, and DBCP. Note the following three points when configuring the connection pool:

Hibernate supports third-party connection pools. the officially recommended connection pools are C3P0, Proxool, and DBCP. Note the following three points when configuring the connection pool:

Hibernate supports third-party connection pools. the officially recommended connection pools are C3P0, Proxool, and DBCP. Note the following three points when configuring the connection pool:

1. Apche's DBCP is supported in Hibernate2, but it is no longer recommended in Hibernate3. The official explanation is that this connection pool has defects. If you need to use DBCP in Hibernate3 for some reason, we recommend that you use the JNDI method.

2. By default (that is, if the connection pool is not configured), Hibernate uses the built-in connection pool. However, this connection pool has poor performance and many bugs. (the default value is used in the program connecting to the oralce database. As a result, if no operation is performed in one night, an error is reported that the connection has expired ), therefore, the official recommendation is only available in the development environment.

In addition, some foreign articles say that C3P0 has some defects in performance (its algorithm is not optimal), and Proxool is the one with the least negative comments.

If you really want to use C3P0, refer to the following method:

1. Add jar package -- c3p0-0.9.1.jar for the project

2. Add in hibernate. cfg. xml

30
2
5000
100
3000
2
False
Org. hibernate. connection. C3P0ConnectionProvider
True


Complete these two steps.

We recommend that you use Proxool to configure the connection pool as follows:

1. Obtain proxool
Download from proxool official website and use hibernate version compatible with the proxool-x.x.x.jar, the official website address is

2. Compile the proxool configuration file

In the same directory as hibernate. cfg. xml, create the file ProxoolConf. xml with the following content:





ServerPool

Jdbc: Oracle: thin: @ 101.162.172.79: 1600: yytest
Oracle. jdbc. driver. OracleDriver





90000

20

5

100

10

Note: in actual use, it is best to remove the comment; otherwise, an error may be reported, as if I reported an error (Proxool Provider unable to load JAXP aggregator file: proxool. xml )..

Related reading:

Java Web Database Connection Pool proxool configuration details

Hibernate details: click here
Hibernate: click here

Hibernate Chinese manual PDF

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.