Manual

tx.rollback();
Connection Pooling
Connection Pooling is a cache of database connections maintained in the database memory so
that the database connections can be reused when the database receives any future requests for
data. In this case, whenever a database operation needs to be performed, a request for an existing
database connection is made to a pool or any object that holds the existing database connections.
Once that particular database operation is completed, the connection is returned to the pool.
Different types of connection pooling are:
Connection Pooling provided by Hibernate
Connection Pooling using C3P0
Connection Pooling using JDBC T2 or T4 driver
In order to enable connection pooling in your application, many vendors provide their own
customized Datasource Interfaces. However, we recommend the use of Apache C3P0 as the
Datasource Interface to be used with Hibernate applications. Hibernate framework distribution
contains the necessary files to use Apache C3P0 0.9.1.2 as the Datasource Interface for
connection pooling.
To configure connection pooling using Apache C3P0, complete the following steps:
1. Add the c3p0-0.9.1.jar in your application CLASSPATH.
NOTE: c3p0-0.9.1.jar is available along with the Hibernate distribution package at
<Hibernate Home>/lib directory.
2. Set some properties in the hibernate.cfg.xml or hibernate.properties file of your
Hibernate application to configure Apache C3P0 connection pooling. The details of these
properties are provided in http://www.mchange.com/projects/c3p0/ index.html#appendix_a
NOTE: Hibernate provides additional configurations related to JDBC, Caching, and Transaction
Management. These configurations are optional and are discussed in http://www.hibernate.org/
hib_docs/reference/en/html/configuration-optional.html#configuration-optional-properties.
Module File Caching Configurations
The Module File Caching (MFC) feature shares the prepared statement plans among the NonStop
SQL/MX database connections and helps in reducing resource consumption. MFC is disabled
by default; therefore, it must be configured to enable it.
To use the MFC feature, you must perform the following activities:
Configuring NonStop SQL/MX DataSource for MFC
Modifying the Hibernate Application
NOTE: JDBC Type 4 driver offers MFC feature.
Configuring NonStop SQL/MX DataSource for MFC
To configure MFC on a NonStop system, complete the following steps:
1. Enter the SQL/MX Connectivity Service (MXCS) subsystem using the SQL/MX Conversational
Interface (MXCI) subsystem:
mxci>> mode mxcs;
2. Configure a datasource for the user specified association service (MXOAS service):
mxci>> add ds $mcbs."MFC_datasource";
Module File Caching Configurations 327