-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Caching strategy for immutable objects
PostPosted: Sat Sep 01, 2007 5:29 am 
Newbie

Joined: Fri Apr 02, 2004 2:34 am
Posts: 8
Location: Germany
Hibernate version: 3.2.4

Name and version of the database we are using: Oracle 9i

I have a general question about object fetching. We are working on the system where all objects are efficiently immutable, i.e. all changes of the objects are done elswhere and our application (GUI) only shows the data from the database. Each change we need to do is communicated to the backend and backend notify GUIs as soon as changes are done and information in the GUI need to be refreshed.
The problem is that as in any normal GUI (swing) we don't have a web-specific request/response flow, where database connection is reoppened every request, connection is open always as long as GUI client is running.
Since all information is immutable and we have notifications from the backend we need to cache everything, means every object from the database needed to be cached, it's possible with Hibernate and with 2nd level caching, it work perfect.
There are however some issues with notifications, because according to the classical MVC, Model need to notify View about any changes, therefore when for example object instance was modified in the backend then all view that are showing given model object should be notified, in combination with object immutability this effectively means that we should only have one instance of every persistent object in the system available, and no second instance should exists (say one instance of User with ID=2 and one instance User#3).

My question is that is it possible to support given requirements with Hibernate, because since 2nd level cache caches dehydrated instances, each time new object instance is fetched (allthough with the same data).
Is there any possibility to enable instance-level caching which will be safe enough approach when all objects are immutable?

Thank you,
Renat

_________________
Br.
Renat


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.