I have just had a worry regarding fail-over/load balancing and use of secondary cache.
Scenario:
- The user starts a session, which is allocated to Server A.
- Several pages are navigated, and the data are stored to hibernate
- Load on the system is high and the Webserver allocates the next request to Server B.
- The user returns to an earlier page, the data are correctly displayed, having not been in the cache and therefore retrieved from the database.
- The user alters some value and navigates off the page, the value is saved to the database
- The next request is serviced from server A and returns again to the earlier page.
In this scenario we need to detect that the session has switched server and force hibernate to ignore the secondary cache for that query (however we want it cached for future calls). How is this best achieved, we are using EHCache and Websphere.
Many thanks, Pete.
|