ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mathew, Sijo " <sijo.mat...@citi.com>
Subject Generation of hash key uses IdentityHashCode (in the class CacheKey)
Date Fri, 14 Nov 2008 19:44:23 GMT
Why are we using identityHashCode (code snippet given below) to build
the hash key for the object to be put in the Cache? Is there any config
setting to prevent this?

In distributed Caching scenario, this will create different hash keys
for the same query with the exact same parameters. This also means that,
the existing OSCACHE implementation cannot be used in a distributed

//from the class SqlMapExecutorDelegate
public int hashCode() {
    CacheKey key = new CacheKey();
    if (txManager != null) {
      if (txManager.getConfig().getDataSource() != null) {
    return key.hashCode();

Sijo Mathew

View raw message