What is the difference between ejbCreate() and ejbPostCreate()

Answered by Jey on 2005-05-08 11:14:33:

Session and Message Driven Bean will have only ejbCreate() method and no ejbPostCreate() method. Entity bean will have both ejbCreate() and ejbPostCreate() methods.  

The ejbPostCreate method returns void, and it has the same input parameters as the ejbCreate method. If we want to set a relationship field to initialize the bean instance, we should do so in the ejbPostCreate method. we cannot set a relationship field in the ejbCreate method.  

The ejbPostCreate() allows the bean to do any post-create processing before it begins serving client requests. For every ejbCreate() there must be a matching (matching arguments) ejbPostCreate() method.

Showing Answers 1 - 5 of 5 Answers

Jey

  • May 8th, 2005
 

Session and Message Driven Bean will have only ejbCreate() method and no ejbPostCreate() method. Entity bean will have both ejbCreate() and ejbPostCreate() methods.  
The ejbPostCreate method returns void, and it has the same input parameters as the ejbCreate method. If we want to set a relationship field to initialize the bean instance, we should do so in the ejbPostCreate method. we cannot set a 
relationship field in the ejbCreate method.  
The ejbPostCreate() allows the bean to do any post-create processing before it begins serving client requests. For every ejbCreate() there must be a matching (matching arguments) ejbPostCreate() method.

  Was this answer useful?  Yes

Mohan

  • May 21st, 2005
 

postCreate give you an opportunity to initialize what was created using ejbCreate

  Was this answer useful?  Yes

Sanjay Guha

  • May 25th, 2005
 

The ejbCreate is invoked by the container prior to the bean being created, and prepares the bean for creation. The ejbPostCreate is invoked by the container directly after the 
bean instance is created, to perform any follow-up methods, just before the result is returned to the client.

  Was this answer useful?  Yes

Sunil Kumar Naik

  • Oct 28th, 2005
 

what we r writing in ejbpostcreate()?Explain with some example?

  Was this answer useful?  Yes

GG

  • Mar 13th, 2006
 

How is ejbPostCreate() perform the fllow-up methods?

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions