-->
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: No row with the given identifier exists and query cache
PostPosted: Thu Jul 07, 2011 3:25 pm 
Pro
Pro

Joined: Wed Nov 05, 2003 7:22 pm
Posts: 211
Hi,

I deleted a bunch of stuff from my database through direct sql and restarted tomcat.

Now, I'm seeing
Code:
Caused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [nl.project.model.Category#28]
        at org.hibernate.impl.SessionFactoryImpl$2.handleEntityNotFound(SessionFactoryImpl.java:435)
        at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:233)
        at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
        at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
        at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090)


Row 28 doesn't exist anymore so if this row was requested it would make sens that the error is thrown.
However, I'm retrieving the row through

Code:
   DetachedCriteria dc = DetachedCriteria.forClass(Category.class);
      dc.add(Restrictions.eq("country", country));
      getHibernateTemplate().setCacheQueries(true);
      getHibernateTemplate().setQueryCacheRegion(CacheRegion.LONGQUERY);
      return getHibernateTemplate().findByCriteria(dc);


The country field is modeled as a foreign key for Category. So there's no many-to-many table or stuff like that.

Is it possible that the query cache persists through a vm restart? If so, how do I flush it?

Kind regards,

Marc


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.