Hello All,
I'm working on the 2-tier Swing multi-user application, after reading this:
http://hibernate.org/333.html
Then this
http://www.archaebacteria.net/?p=7
and
http://forum.java.sun.com/thread.jspa?t ... ID=4080321
It was clear for me that cache and session usage patters are not very suitable for Swing applications, but under some assumptions such as :
1. All loaded objects (Entities) are immutable
2. Hibernate is not used to modify objects in the database, it is done in the backend system.
3. GUIs are not changing data, they are only sending requests to change data in the database and then receive notifications from the backend that data was changed.
My idea was to make session-level cache long-living i.e. shared between multiple hibernate sessions, since sesison-level cache is storing real object instances therefore within it java identity is the same as database identity, and that's exactly what is required for our Swing application.
What do you think, what side-effects this decision could have? What would be the best implementation alternative for that (now I'm thinking about extending DefaultLoadEventListener#loadFromSessionCache method).
Thank you,