4 Replies Latest reply on Mar 30, 2009 9:32 AM by eigenbrodtm

    transient and passivation

      I've tried to put a sessions scoped JSF-backing bean under webbeans controlling rather then configuring it in faces-config.xml.
      I turns out beeing serializable is a strict requirement for session scoped webBeans but wasn't for session scouped JSF beans.
      As a workaround I've made some injected fields transient. However the current specs are not sure whether transient fields will be injected after reactivating a bean.
      Can you sheed some light on this (like how it is done in the current webbeans impl. or make an educated guess about the final spec...)


      Best regards,


      Martin


        • 1. Re: transient and passivation
          pmuir

          Currently we don't reinject fields after activation, though I kind of think we should. I'll try to find out why that note is in the spec, as to me it seems clearcut that we should perform injection after activation for transient injectable fields.

          • 2. Re: transient and passivation
            gavin.king

            Well, the problem is that it can't be made to work for constructor injection.

            • 3. Re: transient and passivation
              gavin.king

              I turns out beeing serializable is a strict requirement for session scoped webBeans but wasn't for session scouped JSF beans.

              Serializability is a strict requirement for anything you put in the HttpSession. Unfortunately, this requirement is not enforced upfront by some web containers and is apparently not validated by your JSF implementation.


              It's much better that web beans does actually validate these things and auto-detects your programming errors, right?

              • 4. Re: transient and passivation

                I agree failing at deployment time is much better thant failing at a later time.


                About reinjecting transitive fields: I thinks this is really needed. I understand it can't be done for Constructor parameters but having it work for injected fields and not for Constructor is still better then having it for non of both.


                By the way I've to say I'm very happy with the fast, friendly and helpfull responses in this forum. Despite the fact that its not final playing with jsr299 / Webbeans is really fun.