Is it possible to implement a cache that applies to the whole application (independent of sessions) and avoids disassembling/assembling objects?
There's one specific class in our application that is read-only and for which an internal registry with all objects is always kept in memory anyway.
(This is to enable complicated business specific queries and searching. Maybe this could have been done with a lot of stored procedures, but that's not the case currently.)
Since all the objects are in memory anyway can I tell Hibernate somehow to reuse them?
This would save us to update/merge these instaces in a lot of places.
I have tried writing a custom second level cache, but that can not make use of the existing objects because it already receives the objects in disassembled state. Besides this uses at least twice the memory...
|