• 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

WAS - Synchronization of Application Data between CLONEs

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
We are having 3 AIX box with WAS 4.0, DB2, each box is having two clones.
Presently each clone is doing its own data caching (which is 100% identlcle
between clones) by storing JavaObjects into a HashMap which is ACTIVE till
the lifecycle of the JVM. We are facing following problem:
- During customer navigation of the site, we sometimes update the CACHE as
well as DB, for example during checkout, if a product becomes out of stock,
at that point of time we update the Database as well us CACHE information.
The hard part is that this CACHE information is updated only for the CLONE
with which user was connected.
In order to solve this we are having a schedulable java program (part of web
application, each clone) which keep on running every 30 minutes and updates
the CACHE by selecting only those rows which are modified after the "last
modified timestamp". But there is a elapsed time of 30 minutes and during
that time server may by out of sync.
I will appreciate if anybody can throw some ideas about this CACHE
synchronization.
Thanks.
SK
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a hard one! Cache consistency in a distributed environment is a tough problem. You've used what is probably the easiest solution (a timeout) -- if I were you I'd just try shortening the timeout and seeing if that doesn't make things acceptable.
Another option is to use messaging (like MQ Series). When a value is updated, it writes a notification to a topic that all of the clones subscribe to. When they receive the notification, they clear out their cache. Of course, you have to put in some tricky logic to make sure you know who originally SENT the notification so they don't clear themselves
A long discussion of this took place here: http://c2.com/cgi-bin/wiki?MessagingToUpdateDistributedCaches
Kyle
[ January 04, 2002: Message edited by: Kyle Brown ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic