• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Entity bean destroyed?

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Saw this question on JDiscuss:

When is an entity bean destroyed? (Select 2 correct options.)

1. When a client calls remove() on the local or remote component interface of the bean.

2. When the application server crashes.

3. When the application server shuts down cleanly.

4. If the corresponding row is deleted from the database.

5. When the client sets all the references to the local or remote interfaces of the bean to null.

6. When all the clients set all the references to the local or remote interfaces of the bean to null.

I picked 2, 3. Correct answers were 1, 4.

Am I misunderstanding the definition of "destroy"? As I understood it, removing the database entry or calling remove() merely puts the bean back into the pool. It is still an entity bean, but not tied to anything in the DB (no identity). To me, this is not destroying the bean, i.e. garbage collecting.

Comments? Thanks.
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Darien, You are not misunderstanding this at all. Options 1 and 4 are correct IF the question read "entity" and not "entity bean" but it does not. I agree with your selections of 2 and 3 because the question asks "entity bean". You may want to bring that to someone's attention on JDiscuss.

HTH
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic