After upgrading to Hibernate 3.1.1 (from 3.0) some of our programs stated to fail with JDBC exceptions stating that "The driver does not support this function."
It's working again, so I thought I'd share the easy, but not-so-obvious, solution with others who might run into the same problem.
You simply have to set hibernate.jdbc.use_get_generated_keys=false
Otherwise, according to the Hibernate documentation, Hibernate "will use JDBC3 PreparedStatement.getGeneratedKeys() to retrieve natively generated keys after insert. Requires JDBC3+ driver and JRE1.4+, set to false if your driver has problems with the Hibernate identifier generators. By default, tries to determine the driver capabilites using connection metadata."
The JDBC driver we are using is from JTOpen 5.0, and it apparantly does not support the above mentioned function.
Kind regards
Claus Nielsen
|