4 Replies Latest reply on Oct 21, 2005 4:13 AM by hceylan

    @PostActivate and @Resource

    mbe1

      Hi all,

      I think I read the entire Forums and got some answers for my current problem, but still there is ONE open question.

      I have a SFSB with injected SessionContext and EntityManager:

      @Resource
      private transient SessionContext ctx;
      
      @PersistenceContext(unitName="KonDISEP-EM")
      private EntityManager em;
      


      When the SFSB gets passivated and then re-activated, the em gets re-injected (or what ever, its works well :) ) but ctx is null.

      HOW to hell, I get ctx re-injected?!? I know, the answer is 42, but maybe not in this case ;)

      Please I help, I'm realy getting mad about this.

      BTW: If ctx is not marked transient, I get the well known StackOverFlow Exception while passivation is running.


      Thanks,

      - Meikel



        • 1. Re: @PostActivate and @Resource
          bill.burke

          The StackOverflow problem should be fixed in RC3. There is a unit test for it...

          What version of EJB3 are you using? The one that comes with 4.0.3 installer is RC2.

          • 2. Re: @PostActivate and @Resource
            mbe1

            Hi Bill,

            yes am currently using the one fom 4.0.3 final installer in combination with JDK 1.5.0_05.


            Thanks,

            - Meikel

            • 3. Re: @PostActivate and @Resource
              mbe1

              Updated to EJB3 RC3. It works now.

              Thanks,

              - Meikel

              • 4. Re: @PostActivate and @Resource

                What a coincidence. I was browsing the source code for that all night. :)

                Anyways,

                Bill I also noticed in this issue that beans are also passivated early.
                Sesion timeout is 300. This is in seconds I guess.
                This is Line 82 in org.jboss.ejb3.cache.simple.SimpleStatefulCache
                if (now - centry.lastUsed >= sessionTimeout)

                so milliseconds and seconds are mixed up I guess.

                Can you confirm?

                Hasan Ceylan