-->
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: object not found error even though it exists in table
PostPosted: Sat Nov 03, 2007 4:44 am 
Newbie

Joined: Sat Nov 03, 2007 4:16 am
Posts: 2
Hi all,

I am using Hibernate 3.2.5.ga and MySql 5.0 for building a web application.

In my web application I create an object of type 'User'.Each 'User' has around 4000 child objects of type 'WordInfo' associated with it.So a 'User' has a set of 'WordInfo'(s). I create a User in one session and retrieve its children WordInfo(s) back in another session using UserId(which is the primary key of User).

The issue I've been facing is quite random.I create a User 2-4 times and then access their children WordInfo in another session.Everything works fine.When I create more Users after this and then access their children,hibernate says no rows exist for WordInfo in the database.I get the following error..

INFO [03 Nov 2007 13:37:39,750] (DefaultLoadEventListener.java:111) - Error performing load command
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.mywords.domain.WordInfo#202152]
at org.hibernate.impl.SessionFactoryImpl$1.handleEntityNotFound(SessionFactoryImpl.java:377)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:145)



But the WordInfo row with id #202152 does exist in the database.I dont know why hibernate says it does not exist?

Has anybody faced this issue before? Please help.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 03, 2007 6:38 am 
Beginner
Beginner

Joined: Thu Apr 12, 2007 3:26 am
Posts: 35
Location: Germany
I haven't encountered such a problem yet but it sounds like an OutOfMemory-Bug.

Do you close/clear your session after you get the children objects for a user and before you get the next children objects for the next user? If not the reason might be that the number of persistent objects in the session increases with each query for the users children objects and is (at some point) too big.

Best Regards
Hoeft


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 03, 2007 7:53 am 
Newbie

Joined: Sat Nov 03, 2007 4:16 am
Posts: 2
thanks for your reply hoeft!

I do close my session after i retrieve child objects.Moreover I retrieve only 10-15 (pagination) child objects in one service call.

I just made changes to my hibernage.cfg.xml configuration file to not use Hibernate's internal pooling algorithm.Instead I'm using c3p0,an open source JDBC connection pool.That seems to have fixed the problem :) .I just read the hibernate documentation that says we should never use default connection pool provided by hibernate in production.That is intended only for development.


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.