Forums Register Login

LookUp the same EJB deployed in 2 different boxes in cluster

+Pie Number of slices to send: Send
Is there any discussion on best practices for looking up EJB in multiple servers that are clustered?

E.g. EJB1.ear is deployed in 2 different WebSphere boxes - box1 and box2. My code (e.g. code.ear) is also deployed in box1 and box2.

Within box 1, code.ear is deployed in a server called Svr1 and EJB1.ear is deployed in a server called Svr2.

Same goes for box2.

I am using WebSphere 5.1.x

Hashtable properties = new Hashtable();
properties.put(Context.PROVIDER_URL, url);
// url = "iiop://" + "myhostname" + ":" + "MyPortNumber";

Can I do the following things?
1) Can I specify virtual host as the hostname for both box1 and box2?

2) Can I skip providing port number?

By doing the above 2 things, can I still get reference to the same EJB that is deployed in box1 and box2?
+Pie Number of slices to send: Send
Hi Sam,

Usually after looking up a bean, what you'll get back is a clustered RMI stub. This stub maintains a list of all servers in the cluster and it also implements the load balancing algorithm. Hence although you looked up the bean on machine1, the requests will be sent to other servers in the cluster as well. However the container could implement very sophisticated algorithms in order to improve the performances. An example could be the collocated ejb objects. If you have a session fa�ade that accesses entity ejbs, what will happen is that the container will make sure that the client requests never lives the same server. Hence all request coming from SLSB A will be redirected to entity ejbs located on the same server instance. Only if the server fails, then the request will be redirected to another server in the cluster.
Regards.
Die Fledermaus does not fear such a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 527 times.
Similar Threads
Config data storage - best practices?
Serialization, Heap and Objects
Deployment queries
cluster in wls6.1 on hp-ux
How many objects are eligible for GC ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:01:46.