2 Replies Latest reply on May 8, 2008 8:35 PM by Ajay Gupta

    A question on custom eviction policies in JBoss Cache

    Ajay Gupta Newbie

      In our company, we have a very simple requirement where we load values from lots of different lookup tables in the database in the application scope at application startup time. We then use those values to render dropdown values in different screens in our applications. The values are always read-only and hence, we do not provide any screens to the users where they can modify these values. However, the user can call support and ask the values to be updated in the database lookup tables. In order to refresh the application scope with new values, everyday at 5 pm, we programmatically run some inhouse custom code that removes all the dropdown values held in application scope and the application then automatically reloads the new values from the database in the application scope.

      We would like to instead loading these dropdown values values in JBoss Cache from the database lookup tables and would like to define an eviction policy that will replace the custom in-house logic that removes all application scope dropdown entries at 5 pm everyday. Currently, I cannot see any eviction policy that JBoss cache out of the box that will evict cache values at a specific time of the day. I do not have much experience with JBoss Cache but would very much appreciate if someone out there can provide some guidance on getting this accomplished.

      Lastly, I must add that we do not need most of the bells-and whistles that JBoss Cache provides since we would not modify these cached values ever (so no need for transactions), we do not have clusters (so, no need for replication) and so on. We just need the cache to be maintained on each JBoss machine.