-->
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.  [ 3 posts ] 
Author Message
 Post subject: Problem with turning off caching of SQL Statements
PostPosted: Wed Sep 28, 2005 8:45 am 
Newbie

Joined: Wed Sep 28, 2005 4:57 am
Posts: 3
Hibernate version: 3

Hi

Im using Tomcat 5.5, Spring framework, Acegi security, Hibernate 3

I have a problem with my webapp. It runs out of memory (java.lang.OutOfMemoryError). I read up on it and tried different ways of fixing it. Then I profiled the application and I see that my memory is full of String objects that does not go away. Below is a very small part of what there is in memory. It is the SQL statements that Hibernate generate. And when I do the same few clicks running the same functions and take another snapshot, and compare it to my first I can see that it generated again huge number of SQL statements and it stays there. The garbageCollector does not remove them. Then I set the properties for c3p0 like this :

<property name="hibernate.c3p0.max_size">1</property>
<property name="hibernate.c3p0.min_size">0</property>
<property name="hibernate.c3p0.timeout">5000</property>
<property name="hibernate.c3p0.max_statements">0</property>
<property name="hibernate.c3p0.idle_test_period">300</property>
<property name="hibernate.c3p0.acquire_increment">2</property>

but still it does not work.



java.lang.String (#fffd1d75) "order0_"
24
java.lang.String (#fffd1d35) "0_"
24
java.lang.String (#fffd1c98) "select order0_.order_id as order1_0_, order0_.capture_date as capture2_174_0_, order0_.order_date as order3_174_0_, order0_.lead_time as lead4_174_0_, order0_.order_number as order5_174_0_, order0_.buyer as buyer174_0_, order0_.chain_id as chain7_174_0_, order0_.status as status174_0_ from order_tbl order0_ where order0_.order_id=? for update"
24
java.lang.String (#fffd1c5b) "rowid_0_"
24
java.lang.String (#fffd1c49) "chain0_"
24
java.lang.String (#fffd1c14) "0_"
24
java.lang.String (#fffd1ba1) "select chain0_.id as id0_, chain0_.name as name179_0_, chain0_.database_name as database3_179_0_, chain0_.customer_id as customer4_179_0_ from chain_tbl chain0_ where chain0_.id=?"
24
java.lang.String (#fffd1b80) "rowid_0_"
24
java.lang.String (#fffd1b6e) "chain0_"
24
java.lang.String (#fffd1b38) "0_"
24
java.lang.String (#fffd1ac5) "select chain0_.id as id0_, chain0_.name as name179_0_, chain0_.database_name as database3_179_0_, chain0_.customer_id as customer4_179_0_ from chain_tbl chain0_ where chain0_.id=?"
24
java.lang.String (#fffd1aa4) "rowid_0_"
24
java.lang.String (#fffd1a92) "chain0_"
24
java.lang.String (#fffd1a5d) "0_"
24
java.lang.String (#fffd19e9) "select chain0_.id as id0_, chain0_.name as name179_0_, chain0_.database_name as database3_179_0_, chain0_.customer_id as customer4_179_0_ from chain_tbl chain0_ where chain0_.id=? for update"
24
java.lang.String (#fffd19c8) "rowid_0_"
24
java.lang.String (#fffd19b6) "chain0_"
24
java.lang.String (#fffd1981) "0_"
24
java.lang.String (#fffd190d) "select chain0_.id as id0_, chain0_.name as name179_0_, chain0_.database_name as database3_179_0_, chain0_.customer_id as customer4_179_0_ from chain_tbl chain0_ where chain0_.id=? for update"
24
java.lang.String (#fffd18ec) "rowid_0_"
24
java.lang.String (#fffd18d8) "deliveryde0_"
24
java.lang.String (#fffd18ae) "0_"
24
java.lang.String (#fffd1839) "select deliveryde0_.delivery_detail_id as delivery1_0_, deliveryde0_.network as network168_0_, deliveryde0_.denomination as denomina3_168_0_, deliveryde0_.quantity as quantity168_0_ from delivery_detail_tbl deliveryde0_ where deliveryde0_.delivery_detail_id=?"
24
java.lang.String (#fffd181a) "rowid_0_"
24
java.lang.String (#fffd1807) "deliveryde0_"
24
java.lang.String (#fffd17dd) "0_"
24
java.lang.String (#fffd1768) "select deliveryde0_.delivery_detail_id as delivery1_0_, deliveryde0_.network as network168_0_, deliveryde0_.denomination as denomina3_168_0_, deliveryde0_.quantity as quantity168_0_ from delivery_detail_tbl deliveryde0_ where deliveryde0_.delivery_detail_id=?"
24
java.lang.String (#fffd1749) "rowid_0_"
24
java.lang.String (#fffd1736) "deliveryde0_"
24
java.lang.String (#fffd170c) "0_"
24
java.lang.String (#fffd1695) "select deliveryde0_.delivery_detail_id as delivery1_0_, deliveryde0_.network as network168_0_, deliveryde0_.denomination as denomina3_168_0_, deliveryde0_.quantity as quantity168_0_ from delivery_detail_tbl deliveryde0_ where deliveryde0_.delivery_detail_id=? for update"
24
java.lang.String (#fffd1676) "rowid_0_"
24
java.lang.String (#fffd1663) "deliveryde0_"


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2005 10:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hibernate generates a static set of sql that never grows after a sessionfactory has been built.

It will go away when you dont hold onto the sessionfactory.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 29, 2005 4:16 am 
Newbie

Joined: Wed Sep 28, 2005 4:57 am
Posts: 3
Thanks Max. Your my hero.


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