This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

WAS - Synchronization of Application Data between CLONEs  RSS feed

Sam Kumar
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3892
  • Mark post as helpful
  • send pies
  • 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:
[ January 04, 2002: Message edited by: Kyle Brown ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!