• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Toplink Caching with load balancing

 
Sri Anand
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are using toplink 10.1.3 with Struts 1.1, we recently added a server for load balancing, but i am not sure if toplink caching needs to be turned off, because there are 2 servers which mean there would be 2 instances of toplink cache (!! i am not sure abt this) so if one instance of cache gets updated .. how abt other i am all confused abt this if i am thinking in right direction.
Can some one make it clear if toplink can handle caching even if there are multiple servers for load balancing of should i turn off the caching
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While I can't speak for Toplink for sure, but I expect there are similarities.

But there are two types of caching, the first is at the JPA EntityManager level. This will always be there, no turning this off.

Then there is another cache level that is more where you are at. Most of these caching solutions can work in a cluster (more than one machine) and has algorithms to handle how it copies or not data that changes on one server to get to the others.

Hope this helps clarify a little bit about what caches are there, and know that you aren't the first to have a cluster, and that the second cache providers have solutions that handle clusters.

Mark
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are several solutions to caching in a clustered environment in TopLink. The solution you use depends on how often your data is updated, how important performance caching is to you, and how important avoiding stale data is to you.

All TopLink caching options can be configured at the class level, so you can use different caching options for different classes depending on their requirements.

- If caching is not important to you, and avoiding stale data is, then you can turn the cache off, you do this by using an "isolated" cache in your TopLink descriptor.

- If caching is important to you, you can configure a coordinated cache for your cluster. This is configured through "RCM" in your TopLink session, and you can use either JMS, RMI or CORBA.

- Other options include using a cache invalidation policy to expire old data, or using refreshing queries to refresh data as required.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic