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 59 of 175    Print  
Can a Session Bean be defined without ejbCreate() method

Answer posted by Mohan on 2005-05-21 19:27:35: No



  
Total Answers and Comments: 11 Last Update: April 12, 2006   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
  Sorting Options  
  Page 1 of 2   « First    1    2    >     Last »  
May 21, 2005 19:27:35   #1  
Mohan        

RE: Can a Session Bean be defined without ejbCreate() method
No
 
Is this answer useful? Yes | No
June 29, 2005 00:50:36   #2  
prasad        

RE: Can a Session Bean be defined without ejbCreate() method
yes,u can develop a bean without create method
 
Is this answer useful? Yes | No
June 30, 2005 15:34:58   #3  
Denis Wang        

RE: Can a Session Bean be defined without ejbCreate() method
No. 
Container creates the bean instance in the following steps. 
1.newInstance(). 2.setSessionContext() 3.ejbCreate(). 
Hence ejbCreate() is required for the beans.

 
Is this answer useful? Yes | No
September 03, 2005 04:19:18   #4  
Priti        

RE: Can a Session Bean be defined without ejbCreate() method
No. As per the EJB specs the ejbCreate method is required. Stateful session can have one or more overloaded create methods but stateless session beans should have only one create method with zero argument.
 
Is this answer useful? Yes | No
September 11, 2005 08:34:07   #5  
Raja Sekhar Reddy T        

multiple.
The ejbCreate() methods is part of the bean's lifecycle, so, the compiler will not return an error because there is no ejbCreate() method.

However, the J2EE spec is explicit:

  • the home interface of a Stateless Session Bean must have a single create() method with no arguments, while the session bean class must contain exactly one ejbCreate() method, also without arguments.
  • Stateful Session Beans can have arguments (more than one create method)


 
Is this answer useful? Yes | No
November 03, 2005 01:37:37   #6  
Mannu Kumar Pandey        

RE: Can a Session Bean be defined without ejbCreate() ...
No. EBcreate method always needed since its executed for create method of a bean which is needed by client to get a remote instance of bean.
 
Is this answer useful? Yes | No
November 10, 2005 10:57:07   #7  
kripa        

RE: Can a Session Bean be defined without ejbCreate() ...
It might not throw a compilation error. But during deployment,it would  throw an error. The bean would not get deployed.
 
Is this answer useful? Yes | No
November 20, 2005 04:31:18   #8  
Madhu Kumar        

RE: ejbCreate()
SessionBean is a interface.So we can implement all abstract methods . other wise we can declare our class has abstract class.If do not immplement ejbCreate() u do not getBean instace ( remote instance) No way to call ur remote methods.Finally we must implement ejbCreate() method.
 
Is this answer useful? Yes | No
December 21, 2005 08:00:21   #9  
madhu        

RE: Can a Session Bean be defined without ejbCreate() ...
we cant write session bean with out ejbcreate() it is mandatory session bean i can't agree with u r answer tell me any example regarding thisregards madhu
 
Is this answer useful? Yes | No
February 20, 2006 02:17:59   #10  
Abhinav Prakash        

RE: Can a Session Bean be defined without ejbCreate() ...

We cannot have a session bean without ejbCreate().

  • the bean class must implement the session bean interface. ejbcreate is declared in the interface.
  • ejbCreate() is a container call back method which is invoked when the cleint calls create on the home stub class, hence if it is not called the life cycle of the bean is not complete, in which case there will be no session bean to use.
  • Wehn we call create on stateful session bean each time a new bean is created, and when we call this on the stateless bean the bean is pulled otu of the pool and assigned the ejbobject which  the client gets.

 
Is this answer useful? Yes | No
  Page 1 of 2   « First    1    2    >     Last »  


 
Go To Top


 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