9 Replies Latest reply on Feb 21, 2014 9:20 AM by welle

    Stateful Session Bean - Timeouts

    welle

      I've changed the default cache for SFSB to Infinispan to enable passivation in WildFly 8.0.0.Final (standalone-full.xml).

       

      Are there any configurations for any time-outs like:

       

      • Time-out before an SFSB is passivated. What is the algorithm now? Is the disk used as an overspill queue when the cache is full or are the oldest SFSB moved to the disk?
      • Time-out before a SFSB is completely removed. They seem to live forever on disk.

       

      Even if I enabling statistics for the Infinispan passivation cache there seems to be a very limited statistics variables that get any values!

        • 1. Re: Stateful Session Bean - Timeouts
          sfcoy

          You can use @javax.ejb.AccessTimeout for the removal timeout (or it's equivalent in ejb-jar.xml).

           

          The passivation timeout configuration (in standalone.xml) appears to have become legacy in WildFly 8.0, so I'm not sure what the new strategy is there.

          • 2. Re: Stateful Session Bean - Timeouts
            welle

            Isn't that annotation just for a timeout when a client tries to obtain a bean instance? It has nothing to do with removal, or have I missed something?

            • 3. Re: Stateful Session Bean - Timeouts
              wdfink

              You are right, IIRC the annotation is for blocking the bean due to concurency.

              • 4. Re: Stateful Session Bean - Timeouts
                sfcoy

                Doh! I had intended to copy this link instead: @javax.ejb.StatefulTimeout.

                 

                Too much multitasking going on...

                1 of 1 people found this helpful
                • 5. Re: Stateful Session Bean - Timeouts
                  welle

                  Thanks!

                   

                  That works as expected. But what I looked for was the possibility to set a default timeout, so not that "well-behaved" applications may get the SFSB removed eventually.

                  • 6. Re: Stateful Session Bean - Timeouts
                    emmartins
                    • 7. Re: Stateful Session Bean - Timeouts
                      welle

                      I don't get it! What is deprecated?

                       

                      Even if WFLY-2298 is about the Infinispan implementation for SFSB, it is mainly about clustering and replication. It is also marked as fixed for 8.0.0.CR1 (and I'm using 8.0.0.Final). I must be missing something here...

                       

                      From what I can see what happens when I change the setup to allow passivating by the following CLI:

                       

                      /subsystem=ejb3:write-attribute(name=default-sfsb-cache, value=passivating)

                       

                      The setup changes to use a local Infinispan cache (I'm running standalone-full.xml, no cluster). I believe the following cache is used:

                       

                      /subsystem=infinispan/cache-container=ejb/local-cache=passivation

                      (How to get this subsystem to report on statistics is another question...)


                      So it is a local cache using Infinispan as it's implementation. Which is fine. I just wondered if there was a default timeout get a SFSB removed eventually, which I guess is not available.

                      • 8. Re: Stateful Session Bean - Timeouts
                        emmartins

                        In that JIRA description you can find:

                         

                        • Eager passivation is unnecessarily expensive, and makes the eventual SFSB removal slower.

                         

                        Then in the EJB subsystem's LocalDescriptions.properties file, which describes each configuration resource:

                         

                        file-passivation-store.idle-timeout.deprecated=SFSBs are no longer passivated eagerly, but only lazily as required by max-size

                        1 of 1 people found this helpful
                        • 9. Re: Stateful Session Bean - Timeouts
                          welle

                          Ok, got it

                           

                          As the "file-passivation-store" is deprecated (that info is found in the XML schema) I used the normal "passivation-store" and couldn't find any setup for what I was looking for.

                           

                          Thanks to you all I now know that there is no such setting available right now.