6 Replies Latest reply on Oct 11, 2010 7:48 AM by mojito java

    Tuning passivation of stateful session ejbs with jboss

    Julien Martin Expert

      Hello,
      In what configuration file can I decide when jboss steps in to passivate a stateful session ejb?
      Thanks in advance,
      Julien Martin.

        • 1. Re: Tuning passivation of stateful session ejbs with jboss
          Darran Lofthouse Master

          If you look in the conf folder you should find a file called 'standardjboss.xml'.

          You should be able to find a container-configuration for 'Standard Stateful SessionBean', this has the settings you require in the 'cache-policy-conf'.

          You could change these values to globaly affect all deploymented or look at the administrators and developers guide for instructions on how to override these values in one of your deployment descriptors.

          • 3. Re: Tuning passivation of stateful session ejbs with jboss
            Puneet Jain Newbie

            Hi,

            where i can state the idlle time out time after whcih my statefu l bean should get removed from the container.
            i do not want it to be passivated.


            regards
            Puneet J

            • 4. Re: Tuning passivation of stateful session ejbs with jboss
              Julien Martin Expert

              Hello Puneetjains,
              Theoretically: make the value for max-bean-life lesser that max-bean-age in standardjboss.xml.
              In practise : I don't see why you would do that.
              Julien.

              • 5. Re: Tuning passivation of stateful session ejbs with jboss
                Puneet Jain Newbie

                Hi,

                i want to do that because of this ssenario.

                There is a transaction attached with a stateful bean and lock on a row in a database.
                i want to remove that lock if the client is idle for some time.



                regards
                Puneet J.

                • 6. Re: Tuning passivation of stateful session ejbs with jboss
                  mojito java Newbie
                  hello,
                  i used the standardjboss file to configure the passivation of stateful beans. the configuration is listed below...the container is not passivating my bean. did i miss anything?!!
                  <container-configuration>
                    <container-name>Standard Stateful SessionBean</container-name>
                    <call-logging>false</call-logging>
                    <invoker-proxy-binding-name>stateful-unified-invoker</invoker-proxy-binding-name>
                  - <container-interceptors>
                    <interceptor  transaction="Both" metricsEnabled="false">org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
                    <interceptor  transaction="Both" metricsEnabled="false">org.jboss.ejb.plugins.LogInterceptor</interceptor>
                    <interceptor  transaction="Both" metricsEnabled="false">org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor>
                  <!--
                   CMT 
                    -->
                    <interceptor  transaction="Container" metricsEnabled="false">org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
                    <interceptor  transaction="Container" metricsEnabled="false">org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
                    <interceptor  transaction="Container" metricsEnabled="false">org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor</interceptor>
                  <!--
                   BMT 
                    -->
                    <interceptor  transaction="Bean" metricsEnabled="false">org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor</interceptor>
                    <interceptor  transaction="Bean" metricsEnabled="false">org.jboss.ejb.plugins.TxInterceptorBMT</interceptor>
                    <interceptor  transaction="Bean" metricsEnabled="false">org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
                    <interceptor  transaction="Both" metricsEnabled="false">org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
                    <interceptor  transaction="Both" metricsEnabled="false">org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
                    <interceptor  transaction="Both" metricsEnabled="false">org.jboss.ejb.plugins.StatefulSessionSecurityInterceptor</interceptor>
                    </container-interceptors>
                    <instance-cache>org.jboss.ejb.plugins.StatefulSessionInstanceCache</instance-cache>
                    <persistence-manager>org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager</persistence-manager>
                  - <container-cache-conf>
                    <cache-policy>org.jboss.ejb.plugins.LRUStatefulContextCachePolicy</cache-policy>
                  - <cache-policy-conf>
                    <min-capacity>50</min-capacity>
                    <max-capacity>1000000</max-capacity>
                    <remover-period>120</remover-period>
                    <max-bean-life>1800</max-bean-life>
                    <overager-period>25</overager-period>
                    <max-bean-age>30</max-bean-age>
                    <resizer-period>400</resizer-period>
                    <max-cache-miss-period>60</max-cache-miss-period>
                    <min-cache-miss-period>1</min-cache-miss-period>
                    <cache-load-factor>0.75</cache-load-factor>
                    </cache-policy-conf>
                    </container-cache-conf>
                  - <container-pool-conf>
                    <MaximumSize>100</MaximumSize>
                    </container-pool-conf>
                    </container-configuration>
                  - <container-configuration>