| It seems it should be Hibernate responsibility to intercept StateDataException, and OptimisticLockException...then ask it's second level cache to invalidate that 'specific' version of entity but I don't see such logic in Hibernate code. I don't understand why you make a distinction here between Infinispan and EhCache, I don't see how any third party cache is expected to 'listen' these exceptions that must be handled. Are you saying that EhCache hook to Hibernate and able to invalidate it's cache when StateDataException, and OptimisticLockException occurs? |