beautypg.com

HP Integrity NonStop J-Series User Manual

Page 113

background image

Connection pooling using C3P0

Table 20 Property settings for C3P0 connection pooling

Example value

Property

Property meaning

15

hibernate.c3p0.max_size

Maximum number of database connections to open

3

hibernate.c3p0.min_size

Initial number of database connections

5000

hibernate.c3p0.timeout

Maximum idle time for a connection (in seconds)

0

hibernate.c3p0.max_statements

Maximum size of c3p0 statement cache (0 to turn off)

3

hibernate.c3p0.acquire_increment

Number of connections in a clump acquired when pool is
exhausted

300

hibernate.c3p0.idle_test period

Idle time before a c3p0 pooled connection is validated (in
seconds)

Validate the connection on checkout. HP recommends setting the hibernate.c3p0.idle_test_period property instead.
Defaults to false.

The following is a sample of C3P0 configuration of hibernate.cfg.xml:

org.hibernate.connection.C3P0ConnectionProvider
3
15
5000
0
3
300

All other properties must be defined in a c3p0.properties file. Put this file in the CLASSPATH
(WEB-INF/classes for example). However, if some of the properties listed above are specified in
c3p0.properties

, they will be overridden by the configuration you have set in your Hibernate

configuration file.

The following is a sample configuration of c3p0.properties file:

c3p0.initialPoolSize=1
c3p0.checkoutTimeout=400

For the complete list of C3P0 properties, see

http://www.mchange.com/projects/c3p0/

index.html#configuration_properties

.

Connection pooling using Proxool

Proxool is another open source JDBC connection pool distributed with Hibernate.

Table 21 Property settings for Proxool connection pooling

Example value

Property

Property Meaning

/path/to/file.xml

hibernate.proxool.xml

Configure Proxool provider using an XML file

/path/to/proxool

hibernate.proxool.properties

Configure the Proxool provider using a properties file

true | false

hibernate.proxool.existing_pool

Configure the Proxool provider from an existing pool

As set by Proxool
configuration

hibernate.proxool.pool_alias

Proxool pool alias to use (required for
hibernate.proxool.existing_pool

hibernate.proxool.properties

hibernate.proxool.xml

)

The following is a sample of Proxool configuration:

name="hibernate.connection.provider_class">org.hibernate.connection.ProxoolConnectionProvider
property
property

A sample proxool.properties file looks like this:

Configuring Hibernate Applications on NonStop Systems

113

This manual is related to the following products: