-->
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.  [ 5 posts ] 
Author Message
 Post subject: Query returns stale data for about two hours post updation
PostPosted: Fri May 05, 2017 6:57 am 
Newbie

Joined: Fri May 05, 2017 6:25 am
Posts: 3
I have a query saying "select count(*) as y0_ from Service this_ where (this_.configstate=? and 1=1)" and another similar query saying "select count(*) as y0_ from Service this_ where (this_.configstate=? and 1=1 and this_.state like ?)" running from one JVM . Service table has been updated through some other JVM with one entry deletion and one entry addition simultaneously. Now, the first query returns stale data while the other query return appropriate data. The only other difference in my eyes is that the first query is very frequently used while the other isn't.

This issue gets corrected post two hours. What could be the probable reason for this issue?


Top
 Profile  
 
 Post subject: Re: Query returns stale data for about two hours post updation
PostPosted: Fri May 05, 2017 10:01 am 
Hibernate Team
Hibernate Team

Joined: Wed Jun 15, 2016 9:04 am
Posts: 24
You don't have a @Cache annotation on your entity do you?


Top
 Profile  
 
 Post subject: Re: Query returns stale data for about two hours post updation
PostPosted: Fri May 05, 2017 11:05 am 
Newbie

Joined: Fri May 05, 2017 6:25 am
Posts: 3
No, the cache is set as NoCacheProvider and session is being opened and closed everytime pre and post queries.


Top
 Profile  
 
 Post subject: Re: Query returns stale data for about two hours post updation
PostPosted: Fri May 05, 2017 12:18 pm 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
Are you using Master/Slave replication and there is a lag between Master and Slave?


Top
 Profile  
 
 Post subject: Re: Query returns stale data for about two hours post updation
PostPosted: Fri May 05, 2017 12:37 pm 
Newbie

Joined: Fri May 05, 2017 6:25 am
Posts: 3
There is no master slave as well.. Just that database is accessed from two JVMs as explained. But the two queries I posted are through same JVM.


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