After some debugging I figured out that there is a bug in Hibernate or EHCache (depends who violated the contract):
Code:
//ReadWriteCache.java
public boolean isGettable(long txTimestamp) {
return freshTimestamp < txTimestamp;
}
isGettable always returned false because freshTimestamp was _always_ significant bigger than txTimestamp (e.g.
4384950622642176 vs.
1070544590106)
This happens because net.sf.ehcache.hibernate.Plugin.nextTimestamp uses Timestamper.next() but net.sf.ehcache.hibernate.Provider.nextTimestamp uses System.currentTimeMillis.
q.e.d.
Sven