This week's book giveaway is in the Python forum.
We're giving away four copies of High Performance Python for Data Analytics and have Tiago Rodrigues Antao on-line!
See this thread for details.
Win a copy of High Performance Python for Data Analytics this week in the Python 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

When is entity considered created?

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, this one is more of a practical interest, than for the exam.
In ejb quiz at Sun's site there was a question, namely "when is the entity considered created?". The correct answer was "right after ejbCreate()".
To the best of my knowledge, this quiz was based on EJB 1.1, and now I want to catch the core of the question applied to EJB 2.0.
As you know, we have a wonderful pretty thing in EJB 2.0 - CMP relations.
Suppose, we have a User entity, which in turn has relationships like this: User->Country, User->MobilePhone.
At the database level the relations are mapped as mandatory (e.g. FK constraint is declared as NOT NULL).
Will I be right if I restate the correct answer now to be "after ejbPostCreate() method"? The relationships are setup in ejbPostCreate(), and if we leave out their initilisation (not setting them), the error will occur at the DB level and up. (proven by practice).
I see the cause of my doubts only in the older version (EJB 1.1) of the quiz.
 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I Agree.
 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this point is made amply clear in Monson- Haefel's book. Also as a side-effect, all the EjbContext methods for entity beans (like getEjbObject) become available starting from ejbPostCreate(), and NOT from ejbCreate().
Thanks
 
Sudd Ghosh
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I meant interface EntityContext and method getEJBObject(). I guess I need to start remembering the exact names (plus cases). May be again start making the flash cards.
Thanks, Sudd
 
Grow your own food... or this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic