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: Hibernate in-list binding Vs Oracle Shared Pool
PostPosted: Wed Dec 07, 2011 7:40 am 
Newbie

Joined: Wed Dec 07, 2011 7:13 am
Posts: 1
We are currently facing a problem conserning the way hibernate generates sql for our hql queries and the way the database manages these queries.
When a list is binded

Code:
queryStr.append(" AND doc.idDms IN (:ids_dms)");
query.setParameterList(ids_dms, myList);


The sql generated is pretty much like

Code:
...iddms in (?,?,?,?,?....)


The number of binded values corresponds to the number of elements in the list.

When using Oracle, the shared pool is filled with query with exactly de same structure but
with a different number of paramaters. From an Oracle point of view these queries are all different.

As a concequence we have:
-hard parsing of all the query and no use of cached information (execution plans, optimizations...)
-shared pool memory increase since multiple version of the same query and additionnal information are stored

My question is there:
-Is there a solution to avoid what is a problem from database point of view?
-Is there best practice concerning the way lists should be managed so that it does not become a problem from database point of view?

I found some information about a solution using jdbc, but nothing with hibernate
http://knol.google.com/k/oracle-passing ... d-variable


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.