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

By: Ash Emailed: 1785 times Printed: 2624 times    

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.

 

 

 

 

Most Viewed Articles (in Interview )

Latest Articles (in Interview)

Comment on this tutorial