aspose file tools*
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
Author

WAS - Synchronization of Application Data between CLONEs

Sam Kumar
Ranch Hand

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

Joined: Aug 10, 2001
Posts: 3879
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 ]

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.
 
Don't get me started about those stupid light bulbs.
 
subject: WAS - Synchronization of Application Data between CLONEs
 
Similar Threads
Hardware Setup for 900 beans???
Session Persistance - Session Data out of sync between clones/clusters
JNDI - Object lookup on another AppServer
Test 252: Mock exam
Test 252 Primer Q&A