This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
I have configured in such a way that, i run a servlet which pulls the data from database and puts in to the L2 cache and i refer this cache hereafter. Problem is when ever updation is done on the datbase, the only way my L2 cache gets updated is by restarting my server and again running my servlet. Is there a way to clear the L2 cache. if so is that entire L2 cache will be deleted or is there a way to clear only few object without restarting the server
if possible kindly let me know some examples Thanks
Yes, first when you define your cache regions for the second level cache, you put the level of updating that would occur, I think as the isolation level. This makes the second level cache update when an update occurs, as long as that update occurs in the same application, if some legacy app changes the data, Hibernate will not know that data has changed and your 2l cache will have stale data.
To evict from Second Level cache you use the evict methods on the SessionFactory, it can evict all or single objects.