posted 17 years ago
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.