Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Avoiding RMI overheads between inter EJB communication with in same JVM

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic