-->
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.  [ 9 posts ] 
Author Message
 Post subject: problem in loading data
PostPosted: Tue Mar 15, 2011 4:36 am 
Newbie

Joined: Tue Mar 15, 2011 4:20 am
Posts: 4
Hi guys, I have a problem with loading data from my database,sometimes hibernate loads half instead of all the data and when I refresh3 or 4 times, it gets fixed. Here is the case:

I have a link and by clicking on it the application should load list of all employees. When I run the application locally and try to load, everything is fine and I see list of all employees.BUT when I deploy the web application on the server and then try to load, sometimes I see only 3 or 4 rows of the employees while I have more than 30 in the database. Then I click 3-4 times to load again and then suddenly everything gets fixed! Can anyone help me on this?

I use hibernate 3,MySQL 5,Flex,BlazeDS.


Top
 Profile  
 
 Post subject: Re: problem in loading data
PostPosted: Wed Mar 16, 2011 4:02 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Which Transaction Isolation Level are you using?

In case you are using READ COMMITTED then you must be aware of the fact,
that your application doesn't see uncommited data,
whilst maybe when you look at MySQL directly you may see uncommited data.

Another question: are you using some Hibernate 2lnd-Level cache implementation ?


Top
 Profile  
 
 Post subject: Re: problem in loading data
PostPosted: Thu Mar 17, 2011 6:42 am 
Newbie

Joined: Tue Mar 15, 2011 4:20 am
Posts: 4
Well I didn't set up the connection isolation property in my hibernate.cfg.xml so It should be in default mode. Should I set it?I can see the whole data in mysql. the problem is that on first click I may see the full list of employees on the sencond I may see the half of the list then on the third click again I may see the full list.
No I don't use any second level caching...


Top
 Profile  
 
 Post subject: Re: problem in loading data
PostPosted: Fri Mar 18, 2011 7:21 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
I suggest you log the jdbc activity with p6spy,
so you can see exactly which query is issued against the database and which result set is returned.

In this way you can see if it is the query to return wrong results,
or if it is somewhere else in the application where certain results are getting undermined.


Top
 Profile  
 
 Post subject: Re: problem in loading data
PostPosted: Mon Mar 21, 2011 7:26 am 
Newbie

Joined: Tue Mar 15, 2011 4:20 am
Posts: 4
I hibernate loading is working correctly... the problem is somewhere with fetching configuration... dont knowww :-((( thanks anyway.


Top
 Profile  
 
 Post subject: Re: problem in loading data
PostPosted: Mon Mar 21, 2011 9:17 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Do you override the equals() and hashCode() of the employee entity?

N.B.: Wrong equals() and/or hashCode() implementations can easy lead to strange behavior.


Top
 Profile  
 
 Post subject: Re: problem in loading data
PostPosted: Mon Mar 21, 2011 11:22 am 
Newbie

Joined: Sat Mar 19, 2011 5:12 am
Posts: 1
pb00067 wrote:
Do you override the equals() and hashCode() of the employee entity?

N.B.: Wrong equals() and/or hashCode() implementations can easy lead to strange behavior.

ee ere chosea~~


Top
 Profile  
 
 Post subject: Re: problem in loading data
PostPosted: Tue Mar 22, 2011 8:46 am 
Newbie

Joined: Tue Mar 15, 2011 4:20 am
Posts: 4
No I didn't implement those functions... :-( should I implement them?


Top
 Profile  
 
 Post subject: Re: problem in loading data
PostPosted: Wed Mar 23, 2011 11:02 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Quote:
should I implement them?

No, usually not.
Only in certain scenarios (i.e. when you intend to work with detached entities) it is necessary to implement them.


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