Forums Register Login

Avoiding RMI overheads between inter EJB communication with in same JVM

+Pie Number of slices to send: Send
How to avoid RMI calls between two or more EJB(s) (Entity beans + session beans)?
Here are two approaches I heard about-
1) I guess the use of the Local Remote interface prevents RMI calls and marshaling or data. But this concept of putting local interface some how restricts to develop a generic EJB cause we never know which client will use it in which way. Does it mean we need to implement all 3 interfaces i.e. Remote, home and Local to write a generic bean?
2) The second way I heard but never used is deploying more than one EJB(s) using same deployment descriptor and bundling in one enterprise archive i.e.EAR file.
Which way is more effective? Any good comment will help us all.
Thanks!!
Java � make things beautiful.
+Pie Number of slices to send: Send
See you cannot avoid RMI calls when your client code(eg.session bean) and Server code(eg Entity bean)lies in two different physical boundaries.This is paradigm of RMI and you have to use it like this only.

Originally posted by naren JavaGini:
How to avoid RMI calls between two or more EJB(s) (Entity beans + session beans)?
So far EJB specification does not provide any flag to distinguish between local Home interface and Home interface(As per my knowledge).It means you need to modify(interfaces) your code everytime when you want to shift client code and server code on same machine or the other way when shifting client code on different machine. Local interfaces are introduecd to avoid RMI calls between codes lying on same machine and ofcourse itz the efficient way of making calls rather than using stubs, skeletons. I would opt for using 2 interfaces rather than 3 depending upon the layed architecture.

Here are two approaches I heard about-
1) I guess the use of the Local Remote interface prevents RMI calls and marshaling or data. But this concept of putting local interface some how restricts to develop a generic EJB cause we never know which client will use it in which way. Does it mean we need to implement all 3 interfaces i.e. Remote, home and Local to write a generic bean?

I would suggest for using same deployment descriptor

2) The second way I heard but never used is deploying more than one EJB(s) using same deployment descriptor and bundling in one enterprise archive i.e.EAR file.
Which way is more effective? Any good comment will help us all.
Thanks!!
Java � make things beautiful.

 
+Pie Number of slices to send: Send
I think how to use Local or Remote component are depend on purpose of bean.
please see topic 5.2 , 5.3, 5.4 in EJB Spec 2.0
will help..
+Pie Number of slices to send: Send
 

2) The second way I heard but never used is deploying more than one EJB(s) using same deployment descriptor and bundling in one enterprise archive i.e.EAR file.



Some servers like weblogic,oracle 9ias, websphere support pass by refernce when remore interfaces are used. This is not a standard.
pie. 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 900 times.
Similar Threads
Remote and Home Interfaces
How Call-by-reference improves Performance in EJB
Local Objects
Should I use EJB?
please answer this 128 questions for WLS. Urgently!
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:15:12.