|
INTERVIEW QUESTIONS
J2EE
EJB
DETAILS
Question: Can a Session Bean be defined without ejbCreate() method?
Answer: 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)
|
|
|
Category |
EJB Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 8816 users |
Added on |
1/5/2010 |
Views |
78945 |
Rate it! |
|
|
Question:
Can a Session Bean be defined without ejbCreate() method?
Answer:
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) Source: CoolInterview.com
without writing ejbCreate method there is no question of developing sessionbean component ejbcreate is not given in any interface but it is still acting as a lifecycle method because in sfsb component there is a chance of taking n number of create() metods based on client requirement because of this reason they not given this ejbcreate in any interface ifhe given in sessionbean interface programmers are restricted to override that pertivcular method only to avoid this problem they not given ejbcreate() method in any interface Source: CoolInterview.com
Answered by: vijay | Date: 4/11/2010
| Contact vijay
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
Why are ejbActivate() and ejb Passivate() included for stateless session bean even though they are never required as it is nonconversational bean?
|
View Answer
|
|
With EJB 1.1 specs, why is unsetSessionContext() not provided in Session Beans, like unsetEntityContext() in Entity Beans?
|
View Answer
|
|
What is the difference between ejbStore() and ejbLoad()?
|
View Answer
|
|
What is the difference between ejbCreate() and ejbPostCreate
|
View Answer
|
|
Does stateless Session bean create() method contain any parameters?
|
View Answer
|
|
Can I develop an Entity Bean without implementing the create() method in the home interface?
|
View Answer
|
|
How can i retrieve from inside my Bean(Stateless session and Entity CMP) the user name which i am serving (the user name of user just logged in my web application)?
|
View Answer
|
|
What is EJB architecture(components)?
|
View Answer
|
|
If my session bean with single method insert record into 2 entity beans, how can I know that the process is done in same transaction (the attributes for these beans are Required)
|
View Answer
|
|
Is there a way to get the original exception object from inside a nested or wrapped Exception (for example an EJBException or RemoteException)
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All EJB Interview Questions & Answers - Exam Mode /
Learning Mode
|