Hibernate Users FAQ - Platform Specific
Platform Specific Issues
Hibernate expects my JDBC driver to support JDBC2 but it doesn't!Set
hibernate.jdbc.batch_size=0
hibernate.jdbc.use_scrollable_resultsets=false
or upgrade your driver to the latest version. Hibernate chooses sensible default values for these properties, based upon your SQL dialect.
My JDBC driver supports batch updates. How come Hibernate doesn't enable them by default?Batch updates seem to be cause problems for some JDBC drivers that claim to support them. We found that batch updates should be disabled for DB2 and Sybase.
Why is Microsoft's own JDBC driver for SQL server not supported?The Hibernate test suite does not complete successfully using Microsoft's driver (even though most of the individual tests are successful). It appears that the failures are due to some strange handling of dates (exactly the same problem occurs with the DataDirect Connect for JDBC driver, which appears to be the same driver). Some people are using Hibernate with the Microsoft driver but they do so at their own risk. Users of the Microsoft driver should not report problems without first verifying that the problem occurs with one of the recommended drivers. The standard test configuration is SQL Server 2000 + JSQL. An evaluation version of JSQL may be downloaded from http://www.j-netdirect.com
Are there known issues with Interbase / Firebird?(Michael Jakl) Yes. Due to some limitations in Interbase / Firebird we must use some workarounds: Always set the size of your statement cache to zero (hibernate.statement_cache.size or hibernate.c3p0.max_statements) If you are altering tables you should be in single user mode. This can be achieved by running gfix -shut. It's also sufficient to have only one database connection open (eg. immediately after starting the application). If more than one connection is open, you will see errors like "table is in use". To restart your database use gfix -online.
I'm having problems with WebLogic Server and a JNDI-bound SessionFactoryThe JNDI implementation in WebLogic Server does not appear to support the Referenceable interface, and exhibits some rather strange behaviour when binding Serializable objects. Please direct complaints to BEA. Workarounds include using a different JNDI implementation (eg. Sun's FSContext) or using some other means of obtaining a SessionFactory.
After a while, Oracle throws this exception: too many open cursorsThe Oracle JDBC driver doesn't much like to have its prepared statements cached. Disable PreparedStatement caching for the connection pool.
MySQL throws an exception: Cannot disable AUTO_COMMITDownload the latest MySQL driver.
I'm having trouble getting beta 3 to work under Resin. Dom4j complains that the XML parser can't validate.The problem is that Resin's built-in parser does not resolve entities. Christian Bauer: I'm using Resin (2.1.6, 2.1.7) with Hibernate for all my Java projects, and it works just fine. My hibernate.jar is in the Context lib directory, though. The only thing I changed in Resin is the XML parser and XSLT processor:
<system-property javax.xml.transform.TransformerFactory=
"org.apache.xalan.processor.TransformerFactoryImpl"/>
<system-property javax.xml.parsers.DocumentBuilderFactory=
"org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
<system-property javax.xml.parsers.SAXParserFactory=
"org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
Aapo Laakkonen: And here is my Saxon settings:
<system-property javax.xml.transform.TransformerFactory=
"com.icl.saxon.TransformerFactoryImpl"/>
<system-property javax.xml.parsers.SAXParserFactory=
"com.icl.saxon.aelfred.SAXParserFactoryImpl"/>
<system-property javax.xml.parsers.DocumentBuilderFactory=
"com.icl.saxon.om.DocumentBuilderFactoryImpl"/>
And you may replace them with whatever you like. In my case I just put saxon and xml-interfaces in resin/lib.
Tomcat throws java.lang.UnsupportedOperationException when fetching a JDBC connectionIn Tomcat (maybe other situations) if you are using the built-in DBCP to as a JNDI datasource, be sure that you do not specify hibernate.connection.username or hibernate.connection.password in either hibernate.cfg.xml or hibernate.properties. DBCP does not implement the version of Datasource.getConnection() that takes a username and password.
|