Avatar of Jay Roy
Jay RoyFlag for United States of America

asked on 

synch ehcache instance

hi guys

I have 3 application servers connected in cluster. each server has its own JVM. There is ehcache instance attached with each jvm. How will i make sure that each ehcache instance is in synch with other ehcache instance(s).

thanks
Java

Avatar of undefined
Last Comment
Jay Roy
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Avatar of Jay Roy
Jay Roy
Flag of United States of America image

ASKER

do you know if that is open source?
thanks
Avatar of Mick Barry
Mick Barry
Flag of Australia image

no it isn't
Avatar of Ajay-Singh
Ajay-Singh

You can use jboss treecache
   http://docs.jboss.org/jbcache/1.2.4/TreeCache/html/
Avatar of Jay Roy
Jay Roy
Flag of United States of America image

ASKER

I have a ehcahce setup in my application, right now it just caches data. Is there anyway i can save the ehcache data in database?
thanks
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Doesn't really make sense to do that.
You've stored it in the cache to *avoid* calling the database.
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Depending on the data you may be able to solve it by giving the data a short lifetime. That way they may get a little out of sync but not for long before they get themselves back in sync.
Avatar of Jay Roy
Jay Roy
Flag of United States of America image

ASKER

from this documentation http://ehcache.org/documentation/distributed_caching.html

>>>A distributed or replicated cache eliminates the per-instance overhead of loading and refreshing multiple caches from a database.
which arises the question how is ehcache and database connected?
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Jay Roy
Jay Roy
Flag of United States of America image

ASKER

is the ehcache instance running on a jvm?..thx
Avatar of Mick Barry
Mick Barry
Flag of Australia image

its just a set of classes, it doesn't run seperately.
ie. the cache is part of your application
Avatar of Jay Roy
Jay Roy
Flag of United States of America image

ASKER

After reading the doc, i see there are two ways, one is through distributed using terracotta like you said which is not oen source and another way is using replicated mechanism. If i want to use the JMS replicated mechanism to keep instances in synch, do i have to buy any product from ehcache?

thanks
Avatar of Mick Barry
Mick Barry
Flag of Australia image

I think replication is available but 100% sure
Avatar of Jay Roy
Jay Roy
Flag of United States of America image

ASKER

objects
any help with this question greatly appreciated

https://www.experts-exchange.com/questions/27060917/unable-to-save-hibernate-inner-objects.html

thanks for help
Java
Java

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.

102K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo