I cannot get batch fetching for my primitive collection to work. The collection is a simple array of long values. There are around 5-6 entries in each collection. The collections only seem to be fetched singly - i have tried various batch sizes up to 100, with no affect. I am happy to continue access the deals collection by priming the secondary cache, its the times that are the problem.
hibernate.default_batch_fetch_size=8
Hibernate version: 3.0.5
Mapping documents:
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="OrderI" table="order"> <id column="id" name="id"> <generator class="native"/> </id> <discriminator column="class" type="string"/>
<subclass name="Order" discriminator-value="A"> <property name="dealtSize2" column="dealt_size2"/> <property name="orderId" column="orderId"/> <property name="ref" column="ref"/> <property name="type" column="type"/> <property name="provider" column="provider"/> <property name="comment" column="comment"/> <property name="price" column="price"/> <property name="dealtPrice" column="dealt_price"/> <property name="dealtSize" column="dealt_size"/> <property name="priceType" column="price_type"/> <property name="stalePrice" column="stale_price"/> <property name="status" column="status"/> <property name="size" column="size"/> <property name="corrected" column="corrected"/> <many-to-one name="orderSet" column="order_set_id" not-null="true"/> <component name="instrument" class="Instrument"> <property name="base"/> <property name="local"/> </component> <map name="deals" table="order_deals" inverse="false" cascade="all"> <key column="order_id"/> <map-key column="deal_id" type="string"/> <one-to-many class="DealI"/> </map>
<primitive-array name="times" table="order_times" batch-size="10"> <key column="order_id"/> <index column="ix"/> <element column="stamp" type="long"/> </primitive-array>
</subclass>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close(): Query q = session.createQuery("from OrderI order"); return q.list();
Full stack trace of any exception that occurs:None
Name and version of the database you are using:MySQL 4.1
The generated SQL (show_sql=true): Hibernate: select orderi0_.id as id, orderi0_.dealt_size2 as dealt3_4_, orderi0_.orderId as orderId4_, orderi0_.ref as ref4_, orderi0_.type as type4_, orderi0_.provider as provider4_, orderi0_.comment as comment4_, orderi0_.price as price4_, orderi0_.dealt_price as dealt10_4_, orderi0_.dealt_size as dealt11_4_, orderi0_.price_type as price12_4_, orderi0_.stale_price as stale13_4_, orderi0_.status as status4_, orderi0_.size as size4_, orderi0_.corrected as corrected4_, orderi0_.order_set_id as order17_4_, orderi0_.base as base4_, orderi0_.local as local4_, orderi0_.class as class from smarttrader_test._order orderi0_ Hibernate: select times0_.order_id as order1_0_, times0_.stamp as stamp0_, times0_.ix as ix0_ from smarttrader_test._order_times times0_ where times0_.order_id=?
......
Debug level Hibernate log excerpt:
|