Add flag to disable timestamps cache; useful for optimizing environments with only natural ID queries
I've enabled the Hibernate query cache. And I've discovered that by using Criteria queries of "natural ID"s solely, there is little reason to replicate the timestamp cache; especially when using clustering.
I added a property setting disables the timestamp cache entirely. What happens in cases where a non-"natural ID" query is made is that the query simply occurs without caching at all, so this works fine.
This is a patch, applied against Hibernate 3.3 branch which allows for timestamp caching to be disabled, i.e., by setting: