• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Frits Walraven
  • Piet Souris

HFEJB Q16 page 371

Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which additional method(s) might the container call when invoking ejbRemove?
A: ejbFind()
B: ejbLoad()
C: ejbStore()
D: ejbActivate()
E: ejbPassivate()
Answer is: B,D
My query is why C is not an answer?
-Walk Rustin
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm.. if you're removing an entity (a row in a db), why would you want to store it?
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the container calls ejbStore() when it wants to be in sync (bean vs. entity) but since you are deleting the entity and "zeroing out" the bean and putting it back into the pool, you don't care what the state of the bean is, thus you need to write it's state back to the entity.
let's say you did call ejbStore() to update the state in the db ... then you would turn around and delete the same row from the db? wasted effort.
Hope this helps.
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic