I've been digging around the CVS tree, on the assumption that this fix would be in here. It seems that the fix that you're referring to is actually the implementation of toString() rather than hashCode(). hashCode() is still broken.
The current v21branch version (1.1.2.6) reads:
Code:
public int hashCode() {
return sqlQueryString.hashCode(); //TODO: VERY inefficient!!!!
}
I've coded the following replacement method:
Code:
import org.apache.commons.lang.builder.HashCodeBuilder;
(**snip**)
public int hashCode() {
return new HashCodeBuilder(59,15).
append(sqlQueryString).
append(firstRow).
append(types).
append(values).
append(namedParameters).
append(firstRow).
append(maxRows).
toHashCode();
}
The 'magic numbers' 59 and 15 are just two random, non-zero, non-even numbers, as specified in the HashCodeBuilder docs.
This has only been lighty tested, but since it matches all of the fields touched in the QueryKey constructor, it seems solid. It certainly fixes the bug I was referring to and the queries that are supposed to be cached are being properly cached,.