-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Forcing Hibernate to use the JDBC3 getGeneratedKeys() (?)
PostPosted: Fri Apr 23, 2004 3:41 am 
Newbie

Joined: Fri Apr 23, 2004 3:35 am
Posts: 8
How can I force Hibernate to use the JDBC3 getGeneratedKeys() function?

I'm using Informix 9.4, and I get always the following message in the logfile :
------------------------------------------
09:01:10,403 INFO SettingsFactory:105 - Use JDBC3 getGeneratedKeys(): false
------------------------------------------

I'm using the following hibernate.cfg.xml :

------------------------------------------
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="connection.datasource">java:comp/env/jdbc/Timesheet</property>
<property name="show_sql">false</property>
<!-- <property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property> -->
<property name="dialect">net.sf.hibernate.dialect.Informix9Dialect</property>
<property name="jdbc.use_getGeneratedKeys">true</property>
<!-- Mapping files -->
<mapping resource="User.hbm.xml"/>
<mapping resource="Client.hbm.xml"/>
<mapping resource="Activityclient.hbm.xml"/>
<mapping resource="Activityprocedure.hbm.xml"/>
<mapping resource="Projectclient.hbm.xml"/>
<mapping resource="Activityentry.hbm.xml"/>
<mapping resource="Department.hbm.xml"/>
<mapping resource="Division.hbm.xml"/>
<mapping resource="Process.hbm.xml"/>
<mapping resource="Project.hbm.xml"/>
<mapping resource="Timeentry.hbm.xml"/>
<mapping resource="Language.hbm.xml"/>
</session-factory>
</hibernate-configuration>
------------------------------------------

Thanx


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 23, 2004 3:48 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
hibernate.jdbc.use_get_generated_keys


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 23, 2004 5:25 am 
Regular
Regular

Joined: Tue Jan 13, 2004 4:57 am
Posts: 83
gavin wrote:
hibernate.jdbc.use_get_generated_keys


N.b.: javadoc is inverted in the source

Code:
   /**
    * Gives the JDBC driver a hint as to the number of rows that should be fetched from the database
    * when more rows are needed. If <tt>0</tt>, JDBC driver default settings will be used.
    */
   public static final String USE_GET_GENERATED_KEYS = "hibernate.jdbc.use_get_generated_keys";
   /**
    * Tells the JDBC driver to attempt to retrieve row Id with the JDBC 3.0 PreparedStatement.getGeneratedKeys()
    * method. In general, performance will be better if this property is set to true and the underlying
    * JDBC driver supports getGeneratedKeys().
    */
   public static final String STATEMENT_FETCH_SIZE = "hibernate.jdbc.fetch_size";


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.