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

By default, the Java runtime reclaims space for unused Java classes. Including this optional argument
may prevent any memory-leak problems.
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 and must be configured to be enabled.
Recommendations
It is recommended to use MFC with Spring and Hibernate under the following conditions:
1.
Always use parameterized queries.
a.
If you are using Hibernate template, then the queries must be parameterized.
For example, if the query is formed as follows:
getHibernateTemplate().find("select count(*) from
then whenever this query is executed MFC treats it as a new query and caches it every
time. This has adverse effect on the execution time of the query.
You can avoid this if the query is formed as follows:
getHibernateTemplate().find("select count(*) from
This generates parameterized query from Hibernate and hence, MFC will be effective.
b.
While using Hibernate sessions, Session.createQuery and
session.createSQLQuery
are available. It is recommended to use parameterized
queries here also.
2.
A query generated by Hibernate contains alias names. If the alias names in the query change,
then MFC will not be effective. The alias names will not change if the application uses a single
session factory.
Whenever a new session factory is created, the alias name generated in the queries will be
different. Hence, MFC will not be effective.
Configuring NonStop SQL/MX DataSource for MFC
For Type 2 driver:
Applications using JDBC Type 2 driver can enable MFC by defining properties. For more
information, see JDBC Type 2 Driver Programmer's Reference for SQL/MX Release 3.2.
For Type 4 driver:
Applications using JDBC Type 4 driver can enable MFC on a Type 4 datasource that will be created
on Nonstop system. For more information, see JDBC Type 4 Driver Programmer's Reference for
SQL/MX Release 3.2.
330 NonStop Specific Configurations