Interview Question: What is the difference between ejbCreate() and ejbPostCreate?

By: Ash Printer Friendly Format    

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.

 

 

 

 

Ask a Question



Most Viewed Articles (in Interview )

What is similarities/difference between an Abstract class and Interface?

Explain the Polymorphism principle.

What is JSP Scriptlet?

What is the difference between Session Bean and Entity Bean?

What is the difference between JTS and JTA?

Interview Question: How is the MVC design pattern used in Struts framework?

Interview Question: What is Action Class?

Interview Question: Why are some of the class and element names counter-intuitive?

Interview Question: What is EJB container?

Interview Question: What is the difference between Message Driven Beans and Stateless Session beans?

Question: What is the directory structure of a web application?

Why J2EE is suitable for the development distributed multi-tiered enterprise applications?

Is Iterator a Class or Interface? What is its use?

What is the difference between jsp:include page and @ include file?

What types of comments are available in the JSP?

Latest Articles (in Interview)

Comment on this tutorial