Search Interview Questions
Question: What is the difference between ejbCreate() and ejbPostCreate
Answer: The purpose of ejbPostCreate() is to perform clean-up database operations after SQL INSERTs (which occur when ejbCreate() is called) when working with CMP entity beans. ejbCreate() is called before database INSERT operations. You need to use ejbPostCreate() to define operations, like set a flag, after INSERT completes successfully.
When working with BMP entity beans, this is not necessary. You have full control over the entire process, so you can place all the necessary logic surrounding your INSERT statement directly in the ejbCreate() method.
Even if you are creating BMP entity beans, the recommendation would still be to include an empty ejbPostCreate() method. Although some application servers will not enforce it, the spec indicates that this placeholder should be there.
Submitted by Jatin Sanghvi ( Jatin.Sanghvi @ mindcraftsoftware . com )
|
|||||||||||
Question: What is the difference between ejbCreate() and ejbPostCreate
Answer: The purpose of ejbPostCreate() is to perform clean-up database operations after SQL INSERTs (which occur when ejbCreate() is called) when working with CMP entity beans. ejbCreate() is called before database INSERT operations. You need to use ejbPostCreate() to define operations, like set a flag, after INSERT completes successfully. 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:-
|
Related Questions | ||
Does stateless Session bean create() method contain any parameters? |
|
|
Can I develop an Entity Bean without implementing the create() method in the home interface? |
|
|
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)? |
|
|
What is EJB architecture(components)? |
|
|
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) |
|
|
Is there a way to get the original exception object from inside a nested or wrapped Exception (for example an EJBException or RemoteException) |
|
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
India News Network |