Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

JDiscuss exam

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When doing a JDiscuss exam. I found apparently two conflicting statements, regarding an entity bean.
Statement one: "When the container calls ejbRemove(), the bean enters the 'Pooled' state and is not necessarily destroyed (via unsetEntityContext() )"
Statement two: "Once the bean is removed, the bean 'does not exist'"
I am fairly confident that it is Statement two that is correct.
Any support ?.
 
Omis Hein
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to your overwhelming help with this one. I must not of mentioned those magic words "Head First EJB", which appears to attract lots of help
In the end I found what i was after in the specs (page 172) and found that statement one was actually correct after all.
Quote from specs :
"The container invokes the ejbRemove() method on an entity bean instance in response to a
client-invoked remove operation on the entity bean�s home or component interface or as the
result of a cascade-delete operation. The instance is in the ready state when ejbRemove() is
invoked and it will be entered into the pool when the method completes."
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One of those subtle times when the distinction between 'bean instance' and 'entity' matters. Calling remove() (and hence ejbRemove()) removes the real-world entity and frees up the bean instance. The bean instance doesn't have to be garbage collected, it can either be re-used to service requests for some other entity, or it can be used to service home interface business methods.
 
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic