Bean destruction on System Exception

Discussions

EJB design: Bean destruction on System Exception

  1. Bean destruction on System Exception (5 messages)

    Please can someone just confirm, does a bean get destroyed if it throws a System exception?

    Cheers.
  2. In EJB 2.0 (and 1.1 I think), a stateful session EJB instance is destroyed if a Runtime exception is thrown.

  3. In EJB 2.0 (and 1.1 I think), a stateful session EJB instance is destroyed if a Runtime exception is thrown.

  4. The statefull session bean instance is destroyed if:
    - system exception occurs during bean method execution
    - timeout occurs
    (this works for EJB 1.1 and later)

    Wojtek
  5. Does this also apply the same for stateless and entity beans?
  6. 1. Entity Beans
    Entity bean is destroyed (in terms of Object.finalize) by the container. Only passivated entity beans can be destroyed. The container is also responsible for passivation.
    From logical point of view (only logical) the Entity Bean instance is destroyed after client calls remove (data is removed from the database).
    2. Stateless Session Bean
    All operations are container initiated. You can set maxBeans and initial bean number in deployment descriptor. You should not make an assumption that you will connect again to the same stateless session bean.

    Regards

    Wojtek