[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4757) nextTimestamp not precise enough for Infinispan 2LC

Galder Zamarreno (JIRA) noreply at atlassian.com
Tue Jan 5 12:27:29 EST 2010


nextTimestamp not precise enough for Infinispan 2LC
---------------------------------------------------

                 Key: HHH-4757
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4757
             Project: Hibernate Core
          Issue Type: Bug
          Components: caching (L2)
    Affects Versions: 3.5.0-Beta-2
            Reporter: Galder Zamarreno
            Assignee: Galder Zamarreno
             Fix For: 3.5


oing some tests we discovered that with Infinispan cached querys are not recognized as UpToDate
when the query call (= the chache put) happens within 100ms after the last UpdateTimestamps invalidation.
This is because Infinispan defines a rather low timestamp granular precision, indeed ehcache's precision goes into milliseconds.
 
 
InfinispanRegionFactory.java:

 public long nextTimestamp() {
      return System.currentTimeMillis() / 100;
   }

EHCache-TimeStamper:
 
public static long next() {
          synchronized(Timestamper.class) {
               long newTime = System.currentTimeMillis() << BIN_DIGITS;
               if (time<newTime) {
                    time = newTime;
                    counter = 0;
               }
               else if (counter < ONE_MS - 1 ) {
                    counter++;
               }
               
               return time + counter;
          }
     }
regards
G.D.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list