This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes ejbPostCreate Method is it compulsory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "ejbPostCreate Method is it compulsory" Watch "ejbPostCreate Method is it compulsory" New topic
Author

ejbPostCreate Method is it compulsory

Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1844
Hi,
Page 124 of the EJB 1.1 specification states " for each ejbCreate(.. ) method the entity bean class must define a matching ejbPostCreate(... ) method . However when i am not defining a ejbPostCreate(.. ) method using the reference implementation things work fine.
Is there something that i am missing.
Ganesh Natarajan
Greenhorn

Joined: Mar 23, 2001
Posts: 3
hi,
It is not necessary. The container will automatically call ejbPostCreate() immediately after ejbCreate().
Frank Lin
Ranch Hand

Joined: Jan 26, 2001
Posts: 76
Originally posted by Rahul Mahindrakar:
Hi,
Page 124 of the EJB 1.1 specification states " for each ejbCreate(.. ) method the entity bean class [b] must
define a matching ejbPostCreate(... ) method . However when i am not defining a ejbPostCreate(.. ) method using the reference implementation things work fine.
Is there something that i am missing.
[/B]

ejbPostCreate() is a must when CMP is used. ejbCreate() is called BEFORE database insert operation. You need to use ejbPostCreate() to define operations, like set a flag, AFTER insert completes sucessfully. With BMP, you have the control over the insert, you can do that right after the JDBC call, within the ejbCreate().
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ejbPostCreate Method is it compulsory
 
Similar Threads
DataSource Connection in ejbCreate?
EJB:: ejbPostCreate()
ejbPostCreate() for session/message beans
CMR save problem
Please Help