• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Entity bean destroyed?

 
Darien Cheung
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • 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.
 
Patrick Williams
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic