-->
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: Error performing load command: org.hibernate.ObjectNotFoundE
PostPosted: Tue Oct 19, 2010 3:23 am 
Newbie

Joined: Tue Oct 19, 2010 2:56 am
Posts: 1
Have been using Coherence for the Query and Second Level Cache.

I am enabling the Query cache for the StoryBean Entity using the following line of code. The results get cached and the subsequent requests are served from cache.

Criteria crit = sess.createCriteria(StoryBean.class).setCacheable(true);

The problem is that there is an update query running which updates the same table. Code is copied below. It uses a named query ( @NamedQuery(name="updateStory", query="update StoryBean as story set story.story_details = :details where story.story_id= :storyID") )

Query query = sess.getNamedQuery("updateStory");
query.setString("details",storyDesc);
query.setString("storyID",storyID);
query.executeUpdate();

This code executes an Update command on the Database and everything works perfectely.

Now the problem is once the Update is done, the next call to the sess.createCriteria(StoryBean.class).setCacheable(true); throws a [org.hibernate.event.def.DefaultLoadEventListener] Error performing load command: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: exception

Hibernate is trying to retrieve the details from cache and its not able to find the updated row from the cache.

Any body has come across this issue ?
hibernate.cfg.xml has the following properties

<property name="hibernate.cache.provider_class">com.tangosol.coherence.hibernate.CoherenceCacheProvider</property>
<!--optimizes cache access for clustered caches by increasing cache reads and decreasing cache updates.-->
<property name="hibernate.cache.use_minimal_puts">true</property>
<!-- Key to enable Query Cache -->
<property name="hibernate.cache.use_query_cache">true</property>
<!-- Key to enable L2 or Second Level Cache -->
<property name="hibernate.cache.use_second_level_cache">true</property>


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.