EJB design: Cluster replication problem, help me!
I have a problem about cluster replication, if anyone knows about it, please tell me.
- Posted by: Junyang Bi
- Posted on: February 09 2004 21:19 EST
I have setted up a cluster with 3 application server, and when user access one of them, the server will add some data into memory. I think the cluster should automaticly replicate the data into other 2 servers. This is right? But the data not been replicated. why? should I do some config to replicate the data?
- Cluster replication problem, help me! by Alan Choy on February 09 2004 22:32 EST
It depends on what kind of data you're talking about. Usually in a cluster the application server would store some information regarding the HTTP session into memory, but not the application data. If you need application data to be replicated, then yes you need to do some coding yourself.
Also, what specific application server you're using, and what version? Each vendor has some unique implementations.
Thank you for the reply. I'm using the weblogic 7.0, and I check the document that it support http session and ejb replication. But my data is store in the static variable of a class which in application layer, so I think I should replicate myself or change the variable as a static variable of a ejb class, right?
> Thank you for the reply. I'm using the weblogic 7.0, and I check the document that it support http session and ejb replication. But my data is store in the static variable of a class which in application layer, so I think I should replicate myself or change the variable as a static variable of a ejb class, right?
In clustered environment, same instance of the application will be running in different instances of weblogic application server. Among these weblogic server instances if the state information is stored in httpsession then httpsession synchroniztion happens at regular intervals as per settings. In order for the http session to get replicated properly the programming considerations should be adhered to:
1. Session Data Must Be Serializable
To support in-memory replication of HTTP session states, all servlet and JSP session data must be serializable
2. Use setAttribute to Change Session State
3. Consider Serialization Overhead
4. Control Frame Access to Session Data
Coming to application data and static information remains same across different instances of the application which are running in the weblogic cluster. If application scope data is getting added based on different scenarios during the application run then this needs to be handled programmatically in the application coding for clustered environment.
This is exactly what Coherence's Replicated Cache does. Allowing for the replication and synchronization of cached (in-memory) data across the cluster throughout the application layer.
Tangosol Coherence: Cluster your Work. Work your Cluster.
Yes, weblogic replicates Http session and SFSB data.
You should not store session specific data in the static variables. If you can do this then its not session specific. Use SFSB fields (which are not static)for this.