-->
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.  [ 1 post ] 
Author Message
 Post subject: Out of memory with many to many mapping
PostPosted: Thu Oct 08, 2009 5:46 pm 
Newbie

Joined: Thu Oct 08, 2009 5:32 pm
Posts: 1
Hi
I recently faced an issue using Hibernate with Tomcat.
Initially i had two tables JOB and Jobfeed. Which had one to many relationship.
JobFeed had FK JOB_ID from JOB table.
So when said give me all the feeds for Job id 8 it wokrd perfectly fine for me. ( It had 120K records)
But then I had to restructure the table and then had to make many to many relation with link table.

so now there are 3 tables
1. JOB with job_ID and other info
2. FEEDS with FEED_ID and other info
3. link table JOB_FEED which has JOB_ID and FEED_ID

now the mapping in job.hbm looks as follows

<set name="feeds" table="JOB_FEED" cascade="none">
<key>
<column name="JOB_ID" precision="22" scale="0" not-null="true" />
</key>
<many-to-many class="Feed" column="FEED_ID" />
</set>

and mapping in FEEDS table is

<set name="jobs" table="JOB_FEED" inverse="true">
<key>
<column name="FEED_ID" precision="22" scale="0" not-null="true" />
</key>
<many-to-many class="Job" column="JOB_ID" />
</set>

And when I try to get job for all feeds I get OutOfMemory in same tomcat server with same amount of data.


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

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.