-->
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: NativeSQLQueryPlan not being GC'd
PostPosted: Sat Aug 29, 2009 12:40 am 
Beginner
Beginner

Joined: Thu Jul 22, 2004 10:51 pm
Posts: 29
Location: sydney australia
Hi,

I've got a process that uses a StatelessSession to invoke many many native SQL queries. To simplify my code, i haven't used JDBC parameters - i've just included the parameters in the statement ie "SELECT a FROM b WHERE c=1" instead of "WHERE c=?".

Originally I planned to use plain JDBC for this, but i was assured that using hibernate would not add much overhead and since we use hibernate for the rest of the project it was simpler to continue configuring the persistence via hibernate.

It worked with the initial load, but have recently been ramping it up and running out of memory even with a 1g allocation.

I've used VisualVM to profile and have found that the culprit seems to be hibernate not de-referencing NativeSQLQueryPlan objects.

QUESTION:
a) is there a way i can force hibernate to clear it's cache of Query Plans
b) is there a way to disable caching of query plans?
c) would using parameters in my queries solve the problem?

thanks, paul.


Top
 Profile  
 
 Post subject: Re: NativeSQLQueryPlan not being GC'd
PostPosted: Sat Aug 29, 2009 12:57 am 
Beginner
Beginner

Joined: Thu Jul 22, 2004 10:51 pm
Posts: 29
Location: sydney australia
and the answer is C.


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.