• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ValueListHandler and cahing

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any idea how to achive caching for all users?
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at the Servlet filters. You can implement caching by using them.
 
Steven Dolan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic