Good afternoon...
Our (read-heavy) web application uses a tangosol coherence distributed cache for clustering. Hibernate side utilizes the query cache. In performance testing I have noticed a significant (40%) performance hit when moving the query timestamp cache from a distributed to a local cache. I believe this is due to the fact that when there have been no updates, the timestamp cache lookup looks first in the near cache and then goes on to the distributed cache. This is a small but noticable hit that gets magnified many times over in the course of one http request.
I note that in UpdateTimestampsCache, this section is commented out (lines 61-66):
Code:
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
}
Wondering what the reason to not insert the query timestamp if it is null? I believe our application will reclaim these performance differences if it only needs to look in the near cache rather than to the distributed cache.
btw we are using hibernate 2.1.6- it seems that this specific class remains the same through current though.
Thanks for any help.