why do we need ejbPostCreate
5 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, June 29, 2004 10:15 PM

why do we need ejbPostCreate() in Entity bean

Re: why do we need ejbPostCreate

Posted By:   Anonymous  
Posted On:   Saturday, July 3, 2004 08:54 PM


The ejbPostCreate method is used to set some relationships between related beans, after the bean has been constructed.





The container calls ejbPostCreate() after it has associated your bean instance with an EJB object. You can now complete your initialization by doing anything you need to that requires that EJB object, such as passing your bean's EJB object reference to other beans. You might also use this method to reset certain transaction-related parameters. For example, you could keep a data status flag in the bean to indicate whether a field has been changed. Because the bean instance may have been used before, these fields might have dirty data.

Re: why do we need ejbPostCreate

Posted By:   Anonymous  
Posted On:   Saturday, July 3, 2004 08:54 PM


The ejbPostCreate method is used to set some relationships between related beans, after the bean has been constructed.





The container calls ejbPostCreate() after it has associated your bean instance with an EJB object. You can now complete your initialization by doing anything you need to that requires that EJB object, such as passing your bean's EJB object reference to other beans. You might also use this method to reset certain transaction-related parameters. For example, you could keep a data status flag in the bean to indicate whether a field has been changed. Because the bean instance may have been used before, these fields might have dirty data.

Re: why do we need ejbPostCreate

Posted By:   Bhagyashree_Jayaram  
Posted On:   Wednesday, June 30, 2004 05:21 AM

Hi,



In the ejbPostCreate is the method which gets called after the record gets inserted into the database so that if you have any problems like DuplicateKeyException etc can be got and caught accordingly.


Hope this helps....


Bhagya

Re: why do we need ejbPostCreate

Posted By:   narender_reddy  
Posted On:   Wednesday, June 30, 2004 02:45 AM

since client cannot interact directly with bean , can only call create method on home interface....there should be someway where the actions that must take place on bean according to neccessity...right..that's why ejbcreate will be called by container after client calls create() method....hope this will help u a bit....

Re: why do we need ejbPostCreate

Posted By:   Raj_Subramani  
Posted On:   Wednesday, June 30, 2004 02:12 AM


  • Buy the book - Enterprise JavaBeans by Richard Monson-Haefel (or equivalent)

  • read chapter 11




Cheers

-raj

About | Sitemap | Contact