Dear Ranchers,
I have this peculiar requirement to cache objects in an application.
These objects cached are data mainly used for gui-construction.
The problem here is that these data can be updated by the same application, but the changes in the database should not effect till the user forces a refresh on the cache.
Currently, I've tried to do this using two HibernateUtils with two sessionfactories (reading from different hibernate.cfg.xml but using same entities). For the hbms in my HibernateUtils2, i've declared the entity to be read-only.
However, when I updated the object from SessionFactory1, the object cached in SessionFactory2 is also being updated.
The way I can do what I want now is by using 2 separate process.
Any idea, where i've gone wrong? (sorry i'm kinda new to all these orm and especially caching)
Thanks in advance.
Regards
Terry.