Beginner |
|
Joined: Mon Mar 07, 2005 12:02 pm Posts: 39
|
hi there,
I have a problem. I have a object that has a list of tokens. That list is normally VERY big. So I made that specific list lazy=true and I put a batch-size on him and if I try and access the List I still get a java heap space exception. what should I do?
Hibernate version:3.1
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping > <class name="co.za.easypay.easycredit.TempDelivery" table="delivery_tbl" > <id name="id" column="delivery_id" type="java.lang.Long" > <generator class="native"></generator> </id> <many-to-one name="order" class="co.za.easypay.easycredit.Order" cascade="save-update" outer-join="auto" update="true" insert="true" > <column name="order_id" /> </many-to-one> <many-to-one name="serviceProvider" class="co.za.easypay.easycredit.ServiceProvider" cascade="save-update" outer-join="auto" update="true" insert="true" > <column name="sp_ref_no" /> </many-to-one> <bag name="deliveryDetails" table="delivery_detail_tbl" lazy="true" cascade="all" > <key column="delivery_id" > </key> <one-to-many class="co.za.easypay.easycredit.DeliveryDetail" /> </bag> <bag name="tokens" table="token_tbl" lazy="true" cascade="all" batch-size="10" > <key column="delivery_id" > </key> <one-to-many class="co.za.easypay.easycredit.Token" /> </bag> </class>
</hibernate-mapping>
String hql = "from TempDelivery where id = 32"; Delivery del = (Delivery) sess.load(Delivery.class,new Long(32)); List tkns = del.getTokens(); for(int x = 0 ; x < tkns.size() ; x++){ Token tk = (Token) tkns.get(x); System.out.println(tk.getStockType()+tk.getStockId()); }
|
|