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: Query Caching
PostPosted: Thu Nov 16, 2006 10:32 am 
Newbie

Joined: Thu Nov 16, 2006 10:17 am
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
java.lang.reflect.InvocationTargetEx
ception</faultstring><detail> &lt;exception&gt;
&lt;message&gt;More than one row with the given identifier was found: 8982,
for class: com.abc.InventoryView; nested exception is
org.hibernate.HibernateException: More than one row with the given identifier w
as found: 8982, for class: com.abc.InventoryView&lt;/
message&gt;
&lt;class&gt;org.springframework.orm.hibernate3.HibernateSystemException&lt;
/class&gt;
&lt;stackTrace&gt;
org.springframework.orm.hibernate3.HibernateSystemException: More than one row w
ith the given identifier was found: 8982, for class: com.abc.InventoryView; nested exception is org.hibernate.HibernateException: Mor
e than one row with the given identifier was found: 8982, for class: com.abc.InventoryView
Caused by: org.hibernate.HibernateException: More than one row with the given id
entifier was found: 8982, for class: com.abc.Inventor
yView

&lt;rootCause&gt;org.hibernate.HibernateException: More than one row with th
e given identifier was found: 8982, for class: com.abc.InventoryView&lt;/rootCause&gt;
&lt;cause&gt;
&lt;exception&gt;


Name and version of the database you are using:
Oracle 10 G


The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html

Am using the following code for caching an query object.
Query query = session.createQuery("from InventoryView");
query.setCacheable(true);
Also have set this hibernate property in the configuration file.
<prop key="hibernate.cache.use_query_cache">true</prop>

If i use query.setCacheable(true) then the following error is thrown
Wats the possible reason for this?? And in wat other ways can query caching be done.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 2:55 pm 
Newbie

Joined: Thu Nov 16, 2006 11:19 am
Posts: 3
Looks more like your InventoryView might be returning duplicated ids, perhaps if it is a view and your joins came back with dups?

I've had query caching working with OSCache.


Top
 Profile  
 
 Post subject: View returning two records with the same values.
PostPosted: Mon Nov 20, 2006 10:11 am 
Newbie

Joined: Sun Jul 23, 2006 10:52 am
Posts: 3
Location: Bangalore, India
I am also facing the same issue.

The view is returning two rows in which all the values are same.

So the hibernate is not able to distinguish the two objects.

Thanks in advance.

Please help me in solving this issue.


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.