titou09 wrote:
This would not work:
- The batch that load data may be late...
- To my understanding, the "time to live" set the time a given object will stay in the cache. if the object is loaded in the 2LC 5 minutes before the corresponding table is reloaded, the data will be wrong for the next 23h55 because the object will be purged from the cache 24h later...With a long period of high risks of inconsistencies between refreshed tables.
- a workaround would be to preload all the content of those tables in the cache after the load and after the time-to-live expired.... but we'll have to develop some code to do and need to execute that code at the right time. How to synchronise the preload with the cache expiration event?
Definitevely, I think my solution is the more robust and easiest to implenment
thx for your help
BTW.. We are in montreal too..lol
I still feel a little creepy about going through hibernate API to do this. My own preference is to set the time to live to something that would work for you unless you are expecting 24h user interaction like in case of an online shopping software. The time does not really have to be very large. Even every hour refresh rate in many cases is a good refresh time with minimal performance impacts. At the same time, I understand this might be much more critical than what I am projecting here and a robust solution would be inevitable.
Anyhow, it's nice to know a Montreal dude.
Respect
Farzad-