|
Replies:
3
-
Last Post:
Dec 4, 2006 11:27 AM
by: vicnov
|
|
|
|
|
|
|
|
Re: GlassFish v2 cluster & Toplink Essentials cache: how it works together
Posted:
Nov 16, 2006 12:01 PM
in response to: vicnov
|
|
|
Hi,
The object level cache in TopLink serves two main purposes. The first being a performance optimization, minimizing the number of round trips to the database. The second purpose is maintaining object identity within a node.
TopLink Essentials does not automatically propagate changes to different nodes of the cluster, but turning off the cache is generally not the recommended solution. Proper configuration of the cache can help ensure that you are getting correct data, and still getting the performance benefit of caching.
First, you need to pick the right cache types for your application based on the Volatility of your objects. For example, objects that are Read Mostly with lots of sharing might be best configured to use a SoftCacheWeak, whereas objects that are Write Mostly might be best configured with a Weak cache.
Also, configuring locking and refreshing is key in ensuring that stale data is not used.
For more information on locking and caching, please see: http://www.oracle.com/technology/tech/java/newsletter/articles/toplink/toplink_caching_locking.html.
|
|
|
|
|
|
|
|
Re: GlassFish v2 cluster & Toplink Essentials cache: how it works together
Posted:
Nov 21, 2006 8:56 AM
in response to: pkrogh
|
|
|
pkrogh I read this article before (there are not so many articles about Toplink in fact ) - I understand purpose of using Toplink cache. Yes, I can configure cache for each concrete task, for each entity type (in many situations this means that I should turn off the cache...).
Let me describe my question in more details.
This is not a practical task/problem for me now, I am just interested in how it works. I would like to understand. I wonder how GlassFish v2 works with Toplink Essentials in clustered environment - does GlassFish use something special (specific entity cache implementation - maybe plugged into Toplink Essentials) or some specific configuration, etc.
If I understand you correctly, GlassFish uses Toplink Essentials "as is" without any specific configuration/wrappers/workarounds, etc ?
There are several "cluster-aware" caches like EHCache or SwarmCache - in fact it would be great that developers could plug 3rd party cache implementations into Toplink Essentials... (see this issue - https://glassfish.dev.java.net/issues/show_bug.cgi?id=1117). "Choice is good!" (C) http://blogs.sun.com/roumen/entry/choice_is_good Are there any plans or thoughts about this issue in the Community? Or, maybe, there plans to use another mechanisms of entity caching? I think such things as cluster-aware caching are very important for "production class" enterprise server. Or I understand something incorrectly?
|
|
|
|
|
|
|
|
Re: GlassFish v2 cluster & Toplink Essentials cache: how it works together
Posted:
Dec 4, 2006 11:27 AM
in response to: vicnov
|
|
|
Please, could somebody clarify the things?
|
|
|
|
|