• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

ejbPostCreate Method is it compulsory

 
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
It is not necessary. The container will automatically call ejbPostCreate() immediately after ejbCreate().
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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().
 
She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic