-->
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: Hibernate retrieves wrong data
PostPosted: Thu May 18, 2006 1:10 am 
Newbie

Joined: Thu May 18, 2006 12:50 am
Posts: 2
I am usign the hibernate 3.0 for my application. It contains some JAVA API to insert/update/delete the database via hibernate.

I have written some junit test cases to validate the APIs it working fine.But While trying to invoke the same methods from a servlet it gives some wrong data.

Actual Scenario.
I am having a table called users. And I am updating some two fields in the users table. While getting the users Object it gives wrong values for the fourth or in the fifth attempt. It occurs consistently. I am not sure whether there is any issue with the hibernate session.

If anybody aware of this plz show ligth to resolve the same.


Top
 Profile  
 
 Post subject: problem resolved
PostPosted: Fri May 19, 2006 2:11 am 
Newbie

Joined: Thu May 18, 2006 12:50 am
Posts: 2
Actually i tried to fix the issue and i used session.evict(objectName) after stroing the object to a local variable
now it works fine for me

sometimes it is perfect without session.evict(). If anybody knows abt the evict significance do reply me.

BTW what is the best practice to handle the session. if I try to close the session in finally block it throws errors like session already closed. Although I am opening a new session for each method call


Top
 Profile  
 
 Post subject: No one can help you
PostPosted: Fri May 19, 2006 3:19 pm 
Newbie

Joined: Wed May 25, 2005 1:47 pm
Posts: 9
If you you don't show us the code and mapping files.....


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.