File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes OO, Patterns, UML and Refactoring and the fly likes ValueListHandler and cahing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "ValueListHandler and cahing" Watch "ValueListHandler and cahing" New topic
Author

ValueListHandler and cahing

Steven Dolan
Greenhorn

Joined: Jul 06, 2005
Posts: 9
Hi,

Is it possible to have a cache that is common to all users? I am trying to implement something similar to forums where you can create a new topic and add replies to an existing one.

Thanks in advance,

Steven
Steven Dolan
Greenhorn

Joined: Jul 06, 2005
Posts: 9
Any idea how to achive caching for all users?
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Caches are usually just some kind of collection as a static variable on a class with static methods to get & put stuff. So it's that easy to make something available to all users ... in one JVM.

The cache is a gamble that it's worth using up memory to give faster access to frequently requested data than you'd get from a database or file system or some other source. For something like your application, you'd want the data to also be in a database or file system for long term storage and you should update or clear the cache any time you update those external data stores. Now you're also gambling that the complexity of keeping the cache in sync is worth it.

Finally, if you have multiple JVMs in a cluster you have to keep them all in sync. An in-memory cache might be a very complex thing if your data changes often, or a very simple thing if your data never changes.

Any of that sound like you can use it?


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Balachandran Paranjothimani
Ranch Hand

Joined: Jun 18, 2005
Posts: 43
Take a look at the Servlet filters. You can implement caching by using them.


Moderator : <a href="http://groups.yahoo.com/group/OOAD_UML/" target="_blank" rel="nofollow">http://groups.yahoo.com/group/OOAD_UML/</a><br />Home : <a href="http://www.zepho.com" target="_blank" rel="nofollow">http://www.zepho.com</a>
Steven Dolan
Greenhorn

Joined: Jul 06, 2005
Posts: 9
Stan and Balachandran,

Any resource you suggest to read more about caching?

I am planning to implement the cache in the middle tire using VLH and DAO so servlet filters are not an option for me.
Take a look at the Servlet filters. You can implement caching by using them.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I don't know any resources better than Google for "java cache" or for more complex fun "java distributed cache". I make sure in my systems to have a management tool to clear caches in a running system. I can change things in the database and clear cache so the app loads the new data.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ValueListHandler and cahing