-->
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.  [ 2 posts ] 
Author Message
 Post subject: java heap space
PostPosted: Mon Sep 26, 2005 9:28 am 
Beginner
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());
}


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 10:12 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
http://www.hibernate.org/hib_docs/v3/re ... -scrolling


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