Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.2
    • Labels:
      None

      Description

      Stateful Session Beans can be passivated (and so often serialized) by the container to disk to save resources. This behavior can lead to problems with performance, scalability and even robustness of the application. A SFSB may contain non-serializable attributes which prevent a successful serialization and lead to runtime exceptions.

      Proposal: introduction of @NotPassivable annotation (TODO: suggest better name) to prevent passivation of SFSB. SFSB denoted with this annotation should never be passivated and the methods ejbActivate and ejbPassivate never invoked. In an overload scenario the container is supposed to destroy the SFSB instances, instead of passivating them.

      @Documented
      @Target(

      {ElementType.METHOD, ElementType.TYPE}

      )
      @Retention(RetentionPolicy.RUNTIME)
      public @interface NotPassivable {
      }

        Activity

        Hide
        marina vatkina added a comment -

        Interesting. There are no 2 words "passivation capable" in the EJB spec, but googling for them brings a lot of references to the CDI spec or related pages. CDI also defines javax.enterprise.inject.spi.PassivationCapable which can be a good thing that the two names are closed, or can confuse the developers...

        Show
        marina vatkina added a comment - Interesting. There are no 2 words "passivation capable" in the EJB spec, but googling for them brings a lot of references to the CDI spec or related pages. CDI also defines javax.enterprise.inject.spi.PassivationCapable which can be a good thing that the two names are closed, or can confuse the developers...
        Hide
        jlmonteiro added a comment -

        +1 for a new annotation.
        And it seems more consistent with @Cachable in JPA 2. Both are behaviors.

        Show
        jlmonteiro added a comment - +1 for a new annotation. And it seems more consistent with @Cachable in JPA 2. Both are behaviors.
        Hide
        jlmonteiro added a comment -

        Regarding the naming @PassivationCapable(false) looks great for me.

        Show
        jlmonteiro added a comment - Regarding the naming @PassivationCapable(false) looks great for me.
        Hide
        jrbauer added a comment -

        What package would a new annotation reside in? I agree with the idea of making this common metadata at some point, so I don't think we should add another EJB annotation ... and I don't think we should add a new common annotation without working it through other JSRs that be interested (CDI).

        Show
        jrbauer added a comment - What package would a new annotation reside in? I agree with the idea of making this common metadata at some point, so I don't think we should add another EJB annotation ... and I don't think we should add a new common annotation without working it through other JSRs that be interested (CDI).
        Hide
        marina vatkina added a comment -

        See the new section "4.6.5Disabling Passivation of Stateful Session Beans" (and related references to the passivationCapable element) in the next version of the spec

        Show
        marina vatkina added a comment - See the new section "4.6.5Disabling Passivation of Stateful Session Beans" (and related references to the passivationCapable element) in the next version of the spec

          People

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

            Dates

            • Created:
              Updated:
              Resolved: