Apparently, it is not the case.
I have checked the cache and found out that a few of the objects (only but not all of read only ones - maybe coincidentally) are being read from cache. When webbApp1 starts using them for the first time, it tries to "get(...)" them from the cache and only then, if they are not there retrieve them from the DB AND then "put(...)" them into cache.
Strangely, Hibernate does not even try to "get(...)" the rest of the objects from the cache, it starts retrieving them from DB straight away and then "put(...)" into the cache.
As I understand, in the situation when the object is created, the expected behaviour algorithm would be something like this:
1)check the cache if the object is there by calling cache.get(...) of the corresponding *Cache class:
1.1a) if it is not, go to DB and retrieve it return the instance to a caller
saving the copy into the cache by calling cache.put(...)
1.1b) if it is there, retrieve it from cache and return to the caller
So, why it does not work this way in my wabApp, did I go wrong with config settings somewhere?
Please enlighten
|