-->
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.  [ 5 posts ] 
Author Message
 Post subject: outofmemory occurs while listing data using hibernate3.0
PostPosted: Wed Jan 10, 2007 6:42 am 
Newbie

Joined: Thu Jan 04, 2007 5:50 am
Posts: 4
Location: bangalore
I have already post this following problem

"While retriveing data from postgres using hibernate 3.0 its taking too much of time some time its showing outofmemory error

query sample hsql query

from Candidatemaster as a where a.userpk in (select b.userpk from UserAddress as b where b.statepk=1 and b.addres_type=:code)

For Table we created index allso but it still showing out of memory error "




We Treied Through Jdbc Connection it is exquting Quickly (9.seconds)
but while using hibernet its take more time (more than 20 minutes or System throws outofmemory )
Total Tables 65
Hibernet 3.0
Data base postgres

retreiving object is Related with 7 Tables contained 1 lakhs records
we increased our jvm memory size also system ram size 1gb ram

pls give me a any solution


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 10, 2007 6:56 am 
Beginner
Beginner

Joined: Sat Dec 16, 2006 9:53 pm
Posts: 31
Location: Brisbane, Australia
RAM is cheap.


Top
 Profile  
 
 Post subject: Show your mappings
PostPosted: Wed Jan 10, 2007 10:57 am 
Regular
Regular

Joined: Wed Aug 24, 2005 11:49 am
Posts: 63
You say there are 7 tables?
Your query only uses 2.

Maybe you have mapped collections that are being fetched?

_________________
Edwin van der Elst
Finalist IT Group


Top
 Profile  
 
 Post subject: Re: mappings for hbm file
PostPosted: Thu Jan 11, 2007 7:26 am 
Newbie

Joined: Thu Jan 04, 2007 5:50 am
Posts: 4
Location: bangalore
Table 1 Candidatemaster
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<!-- Created Tue Jun 13 16:39:32 GMT+05:30 2006 -->
<hibernate-mapping default-lazy="false">

<class name="org.alpha.boat.domainobjects.CandidateMaster" table="CANDIDATE_MASTER">
<id name="studentPk" column="STUDENT_PK" type="java.lang.Long">
<generator class="increment"/>
</id>

<property name="enrollementNo" column="ENROLLEMENT_NO" type="java.lang.String" />
<property name="candidateName" column="CANDIDATE_NAME" type="java.lang.String" />
<property name="fathersName" column="FATHERS_NAME" type="java.lang.String" />
<property name="dateOfBrith" column="DATE_OF_BRITH" type="java.lang.Long" />
<property name="candidateAge" column="CANDIDATE_AGE" type="java.lang.Long" />
<property name="sex" column="SX" type="java.lang.String" />


<property name="trainingSector" column="TRAINING_SECTOR" type="java.lang.Long" />
<property name="alreadyAppliedIns" column="ALREADY_APPLIED_INS" type="java.lang.Long" />
<property name="statusFalg" column="STATUS_FALG" type="java.lang.Long" />
<property name="dateOfEnrollement" column="DATE_OF_ENROLLEMENT" type="java.lang.Long" />
<property name="examMarkCardNo" column="EXAM_MARK_CARD_NO" type="java.lang.String" />
<property name="physicallyHandicapped" column="PHYSICALLY_HANDICAPPED" type="java.lang.String" />
<property name="sandwichCourse" column="SANDWICH_COURSE" type="java.lang.Long" />
<property name="financialYear" column="FINANCIAL_YEAR" type="java.lang.Long" />
<property name="percentage" column="PERCENTAGE" type="java.lang.Double" />
<property name="resultedDate" column="RESULTED_DATE" type="java.lang.Long" />
<property name="trLevel" column="TR_LEVEL" type="java.lang.Long" />
<property name="enrolledType" column="ENROLLED_TYPE" type="java.lang.Long" />
<property name="estbPk" column="ESTB_PK" type="java.lang.Long" />



<many-to-one name="cityChoice1" column="CITY_CHOICE1" class="org.alpha.boat.domainobjects.DistirctMaster" />
<many-to-one name="cityChoice2" column="CITY_CHOICE2" class="org.alpha.boat.domainobjects.DistirctMaster" />
<many-to-one name="cityChoice3" column="CITY_CHOICE3" class="org.alpha.boat.domainobjects.DistirctMaster" />

<many-to-one name="institutionMaster" column="INSTITUTION_PK" class="org.alpha.boat.domainobjects.InstitutionMaster" />

<many-to-one name="qualificationCategory" column="CATEGORY_PK" class="org.alpha.boat.domainobjects.QualificationCategory" />

<many-to-one name="subjectFieldMaster" column="STUDENT_FIELD_PK" class="org.alpha.boat.domainobjects.SubjectFieldMaster" />

<many-to-one name="userProfile" column="USER_PK" class="org.alpha.boat.domainobjects.UserProfile" />
</class>

</hibernate-mapping>


// UserAddres in this related with UserProfile

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<!-- Created Tue Jun 13 16:39:40 GMT+05:30 2006 -->
<hibernate-mapping default-lazy="false">

<class name="org.alpha.boat.domainobjects.UserAddress" table="USER_ADDRESS">
<id name="userAddressPk" column="USER_ADDRESS_PK" type="java.lang.Long">
<generator class="increment"/>
</id>

<property name="adderssline1" column="ADDERSSLINE1" type="java.lang.String" />
<property name="adderssline2" column="ADDERSSLINE2" type="java.lang.String" />
<property name="adderssline3" column="ADDERSSLINE3" type="java.lang.String" />
<property name="pinCode" column="PIN_CODE" type="java.lang.Long" />
<property name="city" column="CITY" type="java.lang.String" />
<property name="phone1" column="PHONE1" type="java.lang.String" />
<property name="phone2" column="PHONE2" type="java.lang.String" />
<property name="mobile" column="MOBILE" type="java.lang.String" />
<property name="fax" column="FAX" type="java.lang.String" />
<property name="email" column="EMAIL" type="java.lang.String" />

<many-to-one name="addressTypeMaster" column="ADDERSS_TYPE_PK" class="org.alpha.boat.domainobjects.AddressTypeMaster" />

<many-to-one name="distirctMaster" column="DISTIRCT_PK" class="org.alpha.boat.domainobjects.DistirctMaster" />

<many-to-one name="stateMaster" column="STATE_PK" class="org.alpha.boat.domainobjects.StateMaster" />

<many-to-one name="userProfile" column="USER_PK" class="org.alpha.boat.domainobjects.UserProfile" />
</class>

</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 11, 2007 7:39 am 
Beginner
Beginner

Joined: Sat Dec 16, 2006 9:53 pm
Posts: 31
Location: Brisbane, Australia
I'm just a newbie but try it with

<hibernate-mapping default-lazy="true">

I suspect hibernate is following all defined relationships immediately... which I suppose would make one mother of a query.

Keith.


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