Sreekanth wrote:
I am using EHCache provider for hibernate caching.
My code is working very fine with cache.
Cache used for my application is read-write.
I am using load() statements to retrieve the data from oracle database.
But the problem is when i am trying to retrieve the data for second time, I am not able to get latest updated data from database.
I think that when you use the second-level cache, it only knows about changes your application makes to the data, so if another application (or another instance of your application) updates the data, you will not see the changes. You can make the cache expire after a certain amount of time though.
From the Docs:
Code:
Be careful. Caches are never aware of changes made to the persistent store by another application (though they may be configured to regularly expire cached data)