Hi, hibernate guru & fans
Recently, we encountered a tough problem in a project. The customer want to modified the data
manually(bypass the application). Unfutunately, these data are cached. In order to solve
the headache to synchronize cache with the data in database, we deside to simply destroy all cache
and provide an button to let the user trigger this operation.
I searched hibernate's cache api in hope of finding such method.
SessionFactory.close() seems to be a candidate, but besides destroy cache, it also close
connection thus make the SessionFactory unusable.
So I hope there to be an method clearAllCache() in SessionFactory(). In this way, we can
still use SessionFactory after clear all cache and minimize the change to existing codebase.
Regards,
Justin
|