glassfish
  1. glassfish
  2. GLASSFISH-19298

EJB bean class PreDestroy method not called after system exception in business method

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Works as designed
    • Affects Version/s: 3.1.2.2, 4.0_b61
    • Fix Version/s: None
    • Component/s: ejb_container
    • Labels:
      None

      Description

      A RuntimeException occurred in the business method of a stateless bean. As a system exception it will cause the bean instance to be destroyed, and its PreDestroy method invoked.

      When running it on 3.1.2.2 and 4 trunk build, I don't see the pre-destroy methos to be called. So it could be the bean instance is not destroyed, or it is destroyed but didn't call pre-destroy method.

        Activity

        Hide
        Cheng Fang added a comment -

        To run the test app, after deploying test.war:

        curl http://localhost:8080/test/

        check server.log for entries for PostConstruct and PreDestroy, the latter is not present.

        Show
        Cheng Fang added a comment - To run the test app, after deploying test.war: curl http://localhost:8080/test/ check server.log for entries for PostConstruct and PreDestroy, the latter is not present.
        Hide
        marina vatkina added a comment -

        Per EJB 3.2 spec section "4.6.4 Missed PreDestroy Calls"

        The following scenarios result in the PreDestroy lifecycle callback interceptor method(s) not being called for an instance:

        •A system exception thrown from the instance's method to the container.

        Show
        marina vatkina added a comment - Per EJB 3.2 spec section "4.6.4 Missed PreDestroy Calls" The following scenarios result in the PreDestroy lifecycle callback interceptor method(s) not being called for an instance: •A system exception thrown from the instance's method to the container.

          People

          • Assignee:
            marina vatkina
            Reporter:
            Cheng Fang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: