Module file caching configurations, Configuring nonstop sql/mx datasource for mfc – HP Integrity NonStop J-Series User Manual

Page 190

Advertising
background image

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” (page 190)

“Modifying the Hibernate Application” (page 191)

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";

NOTE:

You can configure any number of servers based on your requirement. If you do not

specify the number of servers, the default value (maxserver=5, initserver=1, and
idleserver=1

) is assumed.

3.

Stop the datasource:

mxci>> stop ds MFC_datasource, reason 'test';

NOTE:

This step must be performed only if you have a configured datasource in the started

status.

190 Configuring Hibernate Applications on NonStop Systems

Advertising
This manual is related to the following products: