Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

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().
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic