I'm using the 2nd level cache to do some performance optimizations. I've specified both entity and collection cache-usage (read-write) using EhCache (and defined the needed regions).
Printing out the statistics I see cache misses even on very simple test cases (storing an entity with a collection and then loading it). Entities and queries get hit correctly, but collections miss.
I've activated logging and I see the following message:
Code:
Cached item was locked: foo.bar.myCollection#418396
And a bit above it I see:
Code:
Releasing: foo.bar.myCollection#418396
I tried even adding Thread.sleep between the writing transaction and the reading transaction (tried over 60 seconds) hoping the lock will timeout, but to no avail.
Any ideas?
Hibernate version:
3.1