GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  J2EE  >  EJB
Go To First  |  Previous Question  |  Next Question 
 EJB  |  Question 155 of 175    Print  
how to make a call to ejb a local instead of remote and what is the role of session facade in this procedure

  
Total Answers and Comments: 2 Last Update: October 04, 2006     Asked by: VishwasGenius 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
August 18, 2006 09:24:06   #1  
Sejal S        

RE: how to make a call to ejb a local instead of remot...

Hi,

Making a local call to another EJB sure requires making a JNDI call. But, it doesn't involve the overhead of 'narrowing' operation. i.e. The local call doesn't require the usage of javax.rmi.PortableRemoteObject.narrow() method to marshall the call via RMI. A simple JNDI lookup and appropriate typecast suffices.  

The Session Facade is a design pattern used for reducing multiple method calls over a network. For eg: for a particular business operation there may be a need to make multiple method calls to various entity beans. In this case, a session bean can be implemented as a facade which would access these entity EJBs to make the method calls. Thus, a client makes a single network call to this session bean and the bean in turn accesses the various entity beans locally thus reducing the calls over a network.

Sejal S


 
Is this answer useful? Yes | No
October 04, 2006 05:22:08   #2  
VishwasGenius Member Since: August 2006   Contribution: 13    

RE: how to make a call to ejb a local instead of remot...

HI!

  Sejal Send me important tips that can helpful for all of us


 
Is this answer useful? Yes | No

 Related Questions

Answer posted by Mohan on 2005-05-20 08:44:39: SessionBeans typically are used to represent a client they are of two typse  Stateful Session Beans : they maintain conversational state between 
Latest Answer : Session bean is encapsulates the business logic. and carry out the task for behalf of the client. It have two types.one is stateful session bean. this is maintain the convesional state.another one is stateless session bean. donot maintain the conversional.state. ...

Answer posted by Mohan on 2005-05-20 08:45:36: Stateful session beans have the passivated and Active state which the Stateless bean does not have. 
Latest Answer : Stateful session beans follow the instance passivation techniqueStateless session beans follow the instance pooling technique.ejbActivate() and ejbPassivate() methods are not called in Stateless session beansI ...

Latest Answer : 1. doesnot exsist 2. exsists 3. passivate  invoke ejbcreate() set the sessioncontext() call create()  if the session idle call ejbPassivate() to get back to session call ejbActivate()  to end the ...

Latest Answer : 1. dose not exsist 2. exsist  to start the session set the sessionContext() call create()  to end session call remove ...

Answered by Jey on 2005-05-08 19:41:22: Session bean callback methods differ whether it is Stateless or stateful Session bean. Here they are.  Stateless Session Bean 1. setSessionContext() 2. 
Latest Answer : Session callback methods setSessionContext();unsetSessionContext();ejbLoad();ejbActivate();ejbPassivate();ejbRemove();Entity bean call back methodspublic void setEntityContext(javax.ejb.EntityContext c); public void unsetEntityContext();public void ejbLoad(); ...

Latest Answer : I'll  take a best exmaple to explain.Statefull sessionbean : ATM operationStateless Session Bean : Credit card Once we log into the ATM by entering PIN number. We can do multiple transacations like Balance enquiry, Withdrawl, ministatement..etc... ...

Answered by Jey Ramasamy on 2005-05-08 19:51:04: 1. setEntityContext() 2. ejbCreate() 3. ejbPostCreate() 4. ejbActivate() 5. ejbPassivate() 6. ejbRemove() 7. unsetEntityContext() 
Latest Answer :  setEntityContext(EntityContext) unsetEntityContext() ejbLoad() ejbStore() ejbActivate() ejbPassivate() ejbRemove() ...

Answered by Jey on 2005-05-08 12:51:03: EJB 2.0 adds the local beans, which are accessible only from within the JVM where beans are running in.  In EJB 1.1, we had to implement remote client 
Latest Answer : EJB 2.0 came with new features which not available in EJB1.1 they are auto primarykey generation,EJB-query language,local interfaces,relationships. ...

Answered by Jey on 2005-05-08 12:30:37: Message Driven Bean (MDB) is an enterprise bean which runs inside the EJB container and it acts as Listener for the JMS asynchronous message . It does not have Home 
Latest Answer : Message Driven Bean (MDB) is an enterprise bean which runs inside the EJB container and it acts as Listener for the JMS asynchronous message . It does not have Home and Remote interface as Session or Entity bean. It is called by container when container ...

Answered by Jey on 2005-05-08 12:33:35: If Client and EJB classes are in the same machine ( Same JVM) then we can use Local linterface instead of Remote interface. Since Client and EJB are in same JVM, 
Latest Answer : Local interface is when the client and the ejb are colocated in a same jvm.Here the client is another EJB.In case of Local interface there is no need of throwing RemoteException rather it throws EJB Exception which is a subclass of Runtime Exception.so ...


 Sponsored Links

 
Related Articles

BI Role in Making Corporate Decisions

BI Role in Making Corporate Decisions What is a Corporate Decision A decision that deals with the safety success and livelihood of a business can be defined as a corporate decision These decisions can range anywhere from financial issues and customer satisfaction to product popularity and environmen
 

How does the function call within function get evaluated?

Whenever we have more than one function which is called for a finite number of times then such a function gets evaluated from inside out. Let us understand this concept with an example. For instance consider a function sample called within it 4 times as given in program below: main() { int a=50;
 

How to call C header that is not provided generally by system in C++?

Headers can be called by using extern C Syntax of extern C is: extern "C" <function declaration> for example to call C functions from C++ we can write extern "C" { <function declaration> <function declaration> ...
 

What is difference between call by value and call by reference in function?

The arguments passed to function can be of two types 1. Values passed 2. Address passed The first type refers to call by value and the second type refers to call by reference. For instance consider program1 main() { int x=50, y=70; interchange(x,y); printf(“x=%d y=%d”,x,
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

XML Remote Calling Procedure

XML Remote Calling Procedure XML RPC or the XML Remote Calling Procedure is a set of compilations and implementations which allow certain programs to run on complex platforms or operating systems and allows them to make Remote Procedure calls on the Internet The Remote Procedure Calling Protocol use
 

Role of the Meta Model in NLP

Role of the Meta Model in NLP Armed with a heuristic questionnaire the Meta Model for Neuro linguistic Programming endeavors to recover highly detailed and unambiguous information about the client by challenging his beliefs and line of thought and expanding his personally set boundaries into a more
 

Importance of Proper English during Job Interview

Importance of Proper English during Job Interview Your job interview is crucially important and it will determine whether or not you will get the job Depending on the type of job you re going for it is very important for you to use proper English In most cases jobs which offer higher salaries will h
 

JSP Implicit and Session Objects

JSP Implicit and Session Objects In this JPS tutorial you will learn how to program using JSP JSP expressions and Implicit Objects JSP Session Object methods of session object getAttribute String name getAttributeNames and isNew mosgoogle JSP expressions If a programmer wants to insert data into an
 

Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape