wood burning stoves 2.0*
The moose likes Websphere and the fly likes WAS - Synchronization of Application Data between CLONEs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "WAS - Synchronization of Application Data between CLONEs" Watch "WAS - Synchronization of Application Data between CLONEs" New topic

WAS - Synchronization of Application Data between CLONEs

Sam Kumar
Ranch Hand

Joined: Nov 30, 2001
Posts: 38
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
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
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
[ January 04, 2002: Message edited by: Kyle Brown ]

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
I agree. Here's the link: http://aspose.com/file-tools
subject: WAS - Synchronization of Application Data between CLONEs
Similar Threads
Test 252: Mock exam
Session Persistance - Session Data out of sync between clones/clusters
Hardware Setup for 900 beans???
Test 252 Primer Q&A
JNDI - Object lookup on another AppServer