Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Marshalling and Unmarshalling in local and remote interfaces

 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,
I am slightly confused regarding behaviour of remote and local interfaces.
Say i am calling my EJB (through local interfaces) from my servlet. I have provided ejb reference in web.xml. In this case what i believe marshalling and unmarshalling of parameters wont take place, as i am making local call.
Now in the second scenario i am invoking my EJB (through remote interfaces) againg i have provided ejb-reference in web.xml. Will marshalling and unmarshalling of parameter take place? both my servlet and EJB reside on same JVM, and i believe my app server also knows it because while taking refernce of InitialContext i am simply doing
InitialContext ctx = new InitialContext();
I am not providing URL, Security Credential etc. So app server knows that ejbs reside in the same server. Correct me if i am wrong.


Thnaks
 
kundan varma
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
When you use local interface marshalling and unmarshalling does not take place.
It only happens for REmote interface.If you r using the same JVM then use local interface,it will enhance the performance to a great extent
You should also read some material on marshalling and unmarshalling.
Go through the difference of passing a object in java and java-RMI.
Regards,
kundan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic