3.0 Installation Considerations
As part of the traditional open source "release early, release often" approach, here is an updated version of an Ingres Dialect for Hibernate 3.0. We encourage users to test and provide feedback to the forums on opensource.ca.com .
Hibernate is an object/relational persistence layer and query service for Java. It is supported by JBoss as a professional open source project. For each database supported by Hibernate, there is a "dialect" file written in Java which provides the necessary data type mappings and control information. The IngresDialect.java source file is a replacement for the Hibernate 3.0 Ingres dialect file. This implementation provides better compatibility and greater capability than the minimal implementation provided by Hibernate. It will, however, be periodically submitted back to Hibernate/JBoss as updates become available.
This release of the Ingres Dialect for Hibernate has been tested with the Hibernate 3.0 runtime test suites against Ingres r3. See section "4.2 Optional Configuration" below for special considerations.
The source file IngresDialect.java should be placed in the Hibernate dialect source directory hibernate-3.0/src/org/hibernate/dialect. The existing source file should be renamed or moved prior to installing the new source file.
Once placed in the dialect source directory, the Ingres dialect file will be compiled and installed automatically when Hibernate is built using standard Hibernate build procedures (ant or build.bat).
If not already done, please download and install Ingres r3. From the Ingres installation lib directory, copy the JDBC driver iijdbc.jar to the appropriate Java library or include it in the Java CLASSPATH.
Hibernate can be configured to operate with the Ingres JDBC Driver by making the following changes to the Hibernate properties file hibernate-3.0/etc/hibernate.properties:
- Comment or remove the current dialect and connection properties.
- Add the following properties and substitute your platform/user information:
hibernate.dialect org.hibernate.dialect.IngresDialect
hibernate.connection.driver_class ca.ingres.jdbc.IngresDriver
hibernate.connection.url jdbc:ingres://<host>:<port>
hibernate.connection.username <username>
- Change the following property as indicated:
hibernate.query.substitutions true '1', false '0', yes 'Y', no 'N'
The following configuration items were found to provide the best compatibility when running the Hibernate junit tests:
- While Ingres does not support scrollable cursors, Hibernate may check for this capability even when using forward-only cursor access. Setting the following property in the Hibernate configuration file hibernate-3.0/etc/hibernate.properties may cause some errors to occur when using Hibernate, but was found to solve more problems than it caused when running the Hibernate junit tests:
hibernate.jdbc.use_scrollable_resultset true
- Setting the Ingres JDBC Driver default cursor mode to READONLY matches Hibernate expectations and improves performance. The cursor mode may be set by appending the attribute ';CURSOR=READONLY' to the connection URL or by adding the following line to the file iijdbc.properties and placing the file in a directory which is part of the Java CLASSPATH: ingres.jdbc.property.cursor_mode= readonly
- By default, Hibernate defines string columns in tables as varchar(255). Ingres restricts index key lengths based on page size. The max key length may be exceeded if two or more string columns are combined in a key. A larger max key length can be obtained by setting the DBMS server configuation parameter default_page_size using the Ingres configuration utility 'cbf'. A default page size of 8192 is required for keys with two string columns. Note that the corresponding DMF Cache for the selected page size must be enabled. .
Copyright
2005 Computer Associates International, Inc.
All trademarks, trade names, service marks, and logos referenced herein belong
to their respective companies.