-->
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.  [ 1 post ] 
Author Message
 Post subject: Cause Cache dirty, Why changed the UpdateTimestampsCache?
PostPosted: Mon Nov 20, 2006 8:13 am 
Newbie

Joined: Mon Nov 20, 2006 7:22 am
Posts: 1
I don't know who change the following code in UpdateTimestampsCache.java. but this change was wrong!
The commented code was right. they aren't equivalent.
Code:
            return lastUpdate.longValue() < timestamp.longValue();
//            if ( lastUpdate.longValue() >= timestamp.longValue() ) return false;


Code:
   
UpdateTimestampsCache

public synchronized boolean isUpToDate(Set spaces, Long timestamp) throws HibernateException {
      Iterator iter = spaces.iterator();
      while ( iter.hasNext() ) {
         Serializable space = (Serializable) iter.next();
         Long lastUpdate = (Long) updateTimestamps.get(space);
         if ( lastUpdate==null ) {
            //the last update timestamp was lost from the cache
            //(or there were no updates since startup!)
            //updateTimestamps.put( space, new Long( updateTimestamps.nextTimestamp() ) );
            //result = false; // safer
         }
         else {
            if ( log.isDebugEnabled() ) {
               log.debug("[" + space + "] last update timestamp: " + lastUpdate + ", result set timestamp: " + timestamp );
            }
            return lastUpdate.longValue() < timestamp.longValue();
//            if ( lastUpdate.longValue() >= timestamp.longValue() ) return false;
         }
      }


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.