-->
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.  [ 4 posts ] 
Author Message
 Post subject: How to set hibernate.default_batch_fetch_size
PostPosted: Wed May 10, 2006 3:24 pm 
Newbie

Joined: Tue Mar 14, 2006 6:48 pm
Posts: 9
Hi: I am trying to set the property "hibernate.default_batch_fetch_size". I added a hibernate.properties file to my WEB-INF folder with the following line:

Code:
hibernate.default_batch_fetch_size=16


In my app-servlet.xml file I have:

Code:
   <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
      <property name="locations">
         <list>
            <value>/WEB-INF/jdbc.properties</value>
            <value>/WEB-INF/hibernate.properties</value>
            <value>/WEB-INF/mail.properties</value>
            <value>/WEB-INF/classes/constants.properties</value>
         </list>
      </property>
   </bean>


When the application starts I get:

Code:
INFO  [SettingsFactory.buildSettings 187] Default batch fetch size: 1


How can I set the default batch fetch size to 16?

Michael.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 5:58 pm 
Newbie

Joined: Wed Apr 20, 2005 6:57 pm
Posts: 9
Location: San Diego, Ca
I don't know if this will help you but we use the batch-size tags in the hbm.xmls like so:

<bag
name="experimentsets"
lazy="true"
inverse="true"
batch-size="10"
>
<key>
<column name="PROJECTID" />
</key>
<one-to-many
class="*.*.Experimentset"
/>
</bag>


Top
 Profile  
 
 Post subject: batch-size works
PostPosted: Thu May 11, 2006 12:15 pm 
Newbie

Joined: Tue Mar 14, 2006 6:48 pm
Posts: 9
Hi:

batch-size works fine. I got it to work. Thank you for the suggestion. But I am still curious of how to set the default_batch_fetch_size. Does anyone know how to do this?

Michael.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 11, 2006 1:02 pm 
Newbie

Joined: Wed Apr 20, 2005 6:57 pm
Posts: 9
Location: San Diego, Ca
I forgot to tell you. This is the format of the hibernate properties we use in our xml config file.

<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">net.sf.hibernate.dialect.OracleDialect</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">false</prop>
<!-- ShowSql-->
<!-- prop key="hibernate.show_sql">true</prop-->
<!--prop key="hibernate.max_fetch_depth">1</prop-->
</props>
</property>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.