-->
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: Caching problem (bug!?)
PostPosted: Tue Jan 17, 2006 8:47 am 
Newbie

Joined: Thu Dec 23, 2004 7:23 am
Posts: 12
Location: Melbourne
Hibernate version: 3.0.5

Hi all,

We have to entities A and B and each instance of A may have multiple instances of B. When we enable caching (EHCache) and delete one of the Bs of an A, and then list all the Bs of A we get the following error:

Code:
org.hibernate.ObjectNotFoundException : No row with the given identifier exists: [com.sun2si.nccin.entities.model.DataTypeParameterInfo#864]


The code used to delete the entity is:
Code:
getHibernateTemplate().delete(entityObject);
getSession().flush();


Could it be related to this bug?

Thanks in advance,
Behi

_________________
http://www.koderblogz.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 1:21 pm 
Expert
Expert

Joined: Thu May 26, 2005 9:19 am
Posts: 262
Location: Oak Creek, WI
Hi,

Search for "not-found" in the link below

http://www.hibernate.org/hib_docs/v3/re ... -manytoone

_________________
RamnathN
Senior Software Engineer
http://www.linkedin.com/in/ramnathn
Don't forget to rate.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 18, 2006 5:12 am 
Newbie

Joined: Thu Dec 23, 2004 7:23 am
Posts: 12
Location: Melbourne
ramnath wrote:
Hi,

Search for "not-found" in the link below

http://www.hibernate.org/hib_docs/v3/re ... -manytoone


Thanks,

That helped a lot. BTW I just noticed that the code in question uses a modified version of Spring's OpenSessionInViewFilter:

Code:
public class FlushingSpringSessionInViewFilter extends OpenSessionInViewFilter
{
   protected void closeSession(Session session, SessionFactory sessionFactory) throws CleanupFailureDataAccessException
    {
        if (session != null && session.isOpen() && session.isConnected())
        {
            try
            {
                session.flush();
            }
            catch (HibernateException e)
            {
                throw new CleanupFailureDataAccessException("Failed to flush session before close: " + e.getMessage(), e);
            }
        }

        super.closeSession(session, sessionFactory);
    }
}


Could this also be the reason that the cache behaves the way I mentioned earlier?

Regards,
Behi

_________________
http://www.koderblogz.com


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.