Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Clustering Jboss with Eclipselink(Clustering Jboss with Eclipselink, how does that stuff integrate)
Clustering Jboss with Eclipselink [message #560093] Tue, 21 September 2010 08:00 Go to next message
Heribert Steuer is currently offline Heribert SteuerFriend
Messages: 7
Registered: September 2010
Junior Member
I have a couple of problems understanding how EclipseLink would integrate into a JBoss cluster.

Jboss uses JBoss Cache and underlying JGroups to synchronize the cluster members. When using Hibernate, the JBoss Cache would be configured as a second level cache. This will guarantee that entities and beans are in sync at all time.

EcpliseLinks "coordinated cache" has its own way of synchronizing multiple notes. As far as I know there are 2 dedicated ways of doing so: RMI and JMS. Both ways go in parallel to the JBoss Cache, so you have 2 separate ways of data synchronization!

Is there a mechanism (JTA?) that guarantees that all cluster members have the data in sync at all time? Or is there a race condition that leaves the beans out of sync with their backing entities?

How would one correctly integrate EclipseLink in a application server cluster (JBoss in our case)?

I am pretty new to all this stuff, so chances are good that there is just a lack of knowlege. So I would be happy if someone could enlighten me.

Re: Clustering Jboss with Eclipselink [message #628638 is a reply to message #560093] Thu, 23 September 2010 13:53 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

I am working on an example of how to configure cache coordination in a clustered environment, you can see the current draft here,

http://wiki.eclipse.org/EclipseLink/Examples/JPA/CacheCoordi nation

it uses Oracle WebLogic, but should be applicable to JBoss as well. You can use either JMS or RMI, for JMS you just need to create a Topic, for RMI if JBoss replicates JNDI you should only have to set the protocol to RMI.

EclipseLink does not integrate with the JBoss data cache, and EclipseLink uses an object cache, which is more complex than a data cache, so integrating with the JBoss cache would loose functionality.

EclipseLink's cache coordination does not support JGroups, but is plug-able, so you could implement your own JGroups transport. This should be fairly easy to do, as we did have JGroups support for OC4J at one point, so the hooks are still there. There is an existing enhancement request to support JGroups, you could vote for this.

EclipseLink does provide an API for integration with a third party cache. This is used by the Oracle TopLink integration with Oracle Coherence.


James : Wiki : Book : Blog : Twitter
Re: Clustering Jboss with Eclipselink [message #628707 is a reply to message #560093] Thu, 23 September 2010 18:10 Go to previous messageGo to next message
Heribert Steuer is currently offline Heribert SteuerFriend
Messages: 7
Registered: September 2010
Junior Member
James,

thanks for your reply. How does EclipseLink guarantee that the entity cache is in sync with the application servers stateful session beans that are synchronized on a different channel?

Cheers!
Re: Clustering Jboss with Eclipselink [message #629234 is a reply to message #560093] Mon, 27 September 2010 14:23 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

The EclipseLink cache coordinates with the other EclipseLink session caches in the cluster. How the cache is accessed, (JSP, Servlet, SessionBean) is not relevant.


James : Wiki : Book : Blog : Twitter
Re: Clustering Jboss with Eclipselink [message #629239 is a reply to message #629234] Mon, 27 September 2010 14:56 Go to previous messageGo to next message
Heribert Steuer is currently offline Heribert SteuerFriend
Messages: 7
Registered: September 2010
Junior Member
in fact it is. unless you have eclipselink synchronize its cache in synchronous mode and use jta to keep things atomic there is a huge risk of race conditions.

as server A updates a session bean and a jpa entity, the cluster transports the bean with jgroups and eclipselink the change of the jpa cache e.g. using rmi. these transfers do not have to be in sync!

if now the next request to that bean hits server B it probably reads invalid data from the entity cache of eclipselink unless the cache is synchronized.
Re: Clustering Jboss with Eclipselink [message #629263 is a reply to message #560093] Mon, 27 September 2010 15:55 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Generally it is a good idea to have server affinity enabled to ensure a client's session uses the same server. This avoids excessive synchronization and replication costs.

EclipseLink supports both asynchronous and synchronous cache coordination. asynchronous, as waiting for all the servers to be updated is normally not desirable. There is a slight lag time for the asynchronous coordination to occur.

If you cannot enable server affinity in your application server, and your client is bouncing from server to server, then you may wish to enable synchronous depending on how likely the same client getting stale data is.

In general optimistic locking should be used to avoid an update using stale data, this is true even in a single server environment.

If you really need to ensure a read never gets stale data then you should consider disabling the shared cache (but of coarse this still will not guarantee this, as once you read the data it could be updated by another user, unless you acquire a pessimistic lock (and so does everyone else)).


James : Wiki : Book : Blog : Twitter
Previous Topic:EclipseLink 2.1.0 and Exception [EclipseLink-6004]
Next Topic:EclipseLink logging to file - append instead of overwrite
Goto Forum:
  


Current Time: Sat Apr 20 06:55:14 GMT 2024

Powered by FUDForum. Page generated in 0.12701 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top