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

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


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Galder Zamarreno resolved HHH-4757.
-----------------------------------

       Resolution: Rejected
    Fix Version/s:     (was: 3.5.0-Beta-3)

The fact that Infinispan or JBoss Cache 2nd level cache uses System.currentTimeMillis()/100 is not coincidence but rather a decision taken to get around network latency issues that happen when update timestamps are replicated across the cluster. Note that timestamp invalidation messages are sent asynchronously accross the cluster. 

> 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
>
> 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