This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Implemeting application level cache to cluster

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I need a application level cache to a clustered application. Cache can use database e.g. with entitybean. Web Application will get an interface to this cache via a Singleton class. Cache will handle ids that Web application will need to it's purposes. Ids are reusable so, that Web application gets a free id from cache via Singleton interface and Web application will also frees it when it does not need it anymore (it's read-write cache). After timeout ids should be marked as freed by some logic.
So, my question is:
If this kind of Singleton and entitybean approach is used in clustered environment, what is the righ please to insert this kind of id handling logic? Can entitybean (maybe BMP) contain this kind of logic or should it exist somewhere else?
I have understood that Singleton can not handle this logic because because there might be multiple instances of it in cluster (Singleton instance per JVM).
I have also read some whitepapers considering products like JCache and JCS, but before I staring to use them I would like to know if Singleton & entitybean approach is usable at all.
Any ideas?
Br
ML
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not useful unless you have some sort of synchronization mechanism outside of the EJB's. My Paper on the Distributed Cache Pattern describes this in detail.
Kyle
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mik,
If you are looking for an application level cache to a clustered application take a look at Tangosol's Coherence product.
Coherence has the ability to cache data/objects in a distributed or replicated manner synchronously across the cluster. It implements a locking mechanism along with a javabean event model style notifications of inserts, update and removals.
Data/Objects are accesses and modified through a java.util.Map interface. Very easy to use and 100% reliable.
Later.
 
mik laan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kyle & Co!
Yes, this quite intetested subject ... and
quite difficult too ;=)
Br
Mik
 
    Bookmark Topic Watch Topic
  • New Topic