This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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


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: 1864
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: ejbPostCreate Method is it compulsory
 
It's not a secret anymore!