-->
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.  [ 2 posts ] 
Author Message
 Post subject: Erroneous ObjectNotFound exception ?
PostPosted: Mon Jun 14, 2004 4:41 am 
Newbie

Joined: Tue Apr 06, 2004 5:20 am
Posts: 2
Hi,

We are experiencing problems in Hibernate with the following exception appearing in our unit test logs:

Quote:
net.sf.hibernate.ObjectNotFoundException: No row with the given identifier exists: 33, of class: foo

However this row definitely exists in the database. We have looked into the problem in depth and have traced it to a previous call in the unit tests to the following line in net.sf.hibernate.loader.Loader.doQuery

Quote:
if (owners!=null) registerNonExists(keys, owners, persisters, session);

It seems that this row is being erroneously added to the nonExists collection and is therefore causing the later doLoad call in SessionImpl to bomb out with the ObjectNotFoundException exception.

We have now commented out this line of code and the problem is fixed. This leads us to some questions that we hope you can answer,

1) This code seems designed to optimize performance in some way, why is the caching of rows that don't exist necessary?
2) How is this code inferring whether a particular row exists without selecting it?
3) Why would hibernate try to load a non-existing row in the first place (assuming foreign key constraints are implemented in the DB)
4) In what ways are we affecting the performance of Hibernate by commenting out this line?

Many Thanks,

Adam.[code][/code]


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 7:13 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Sounds like you are reusing a single session across multiple transactions.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.