1 2 Previous Next 24 Replies Latest reply on May 12, 2003 1:00 PM by jk.mkiii

    Stateful SB removed under Stateles :(

    jk.mkiii

      Hi,

      Situation. I have Stateful beans that I have done for previous project. And now I have done stateless bean that uses these old beans.

      But problem is that when there is no activity for some time those stateful beans are first passivated and then removed from disk. And next time call comes to this new stateles bean it tries to use old bean which has been removed from disk.

      And then we have exception because it can't activate this bean that has been removed.

      I tried using jboss.xml and making stateless beans max age to less than time it takes stateful beans to be totally removed, but I must have been doing something wrong because this didn't work.

      Any hints what would be good idea to do in such situation or help how to correctly make my plan work ...or anything?

      And I am using 3.2.0RC3

        • 1. Re: Stateful SB removed under Stateles :(

          show your jboss.xml

          • 2. Re: Stateful SB removed under Stateles :(

            MaxAge is irrelevent for Stateless session beans.

            How does your stateless bean use a stateful bean,
            I don't understand the use case?

            Stateless beans can effectively live forever, their
            numbers are controlled by the pool size.

            Stateful beans live until you invoke remove()
            or they have not been accessed for a configurable
            length of time (to avoid your disk filling up with
            passivated beans).

            Regards,
            Adrian

            • 3. Re: Stateful SB removed under Stateles :(
              jk.mkiii

              I can't make attach work so I just paste jboss.xml to end of this message.

              Case is that I have session bean that is used to save/load data. In create you give selection rule that is used to filter what is shown.

              New stateless session bean is done because access to our repository is done through webservices and so they do not need their own state.

              But because I don't want to redo everything I just get that old stateful bean and use it with correct selection rule (same for all in current system).

              Problem is that when no-one calls our webservices stateful beans are first moved to disk and then finally removed, and stateless beans above them are not removed. So when next time someone calls our webservices we have stateless bean without underlying data connection because cached bean was removed from disk.

              I tried to set max-bean-age to stateless beans so they would be removed in shorter time it takes stateful beans to be totally removed. Looking from "JBoss 3.0 Deployment and Administration Handbook" it would seem that you can set that data for stateless beans, max-bean-life and remover-period are mentioned as stateful only.

              Perhaps I could set stateful beans max-bean-life to new value so they would never be removed, but I think it is not that good idea.


              [** jboss.xml starts here **]

              <?xml version="1.0" encoding="UTF-8"?>
              <!--
              We want to confirm that these session beans are removed before
              session beans under them are removed.
              -->

              <enterprise-beans>

              <ejb-name>Robocop/repository/RepositoryManagement</ejb-name>
              <configuration-name>Shortlived Stateless SessionBean</configuration-name>


              <ejb-name>Robocop/repository/Repository</ejb-name>
              <configuration-name>Shortlived Stateless SessionBean</configuration-name>

              </enterprise-beans>

              <container-configurations>
              <container-configuration extends = "Standard Stateless SessionBean">
              <container-name>Shortlived Stateless SessionBean</container-name>
              <container-cache-conf>
              <cache-policy-conf>
              <overager-period>120</overager-period>
              <max-bean-age>120</max-bean-age>
              </cache-policy-conf>
              </container-cache-conf>
              </container-configuration>
              </container-configurations>

              • 4. Re: Stateful SB removed under Stateles :(
                jk.mkiii

                I can't make attach work so I just paste jboss.xml to end of this message.

                Case is that I have session bean that is used to save/load data. In create you give selection rule that is used to filter what is shown.

                New stateless session bean is done because access to our repository is done through webservices and so they do not need their own state.

                But because I don't want to redo everything I just get that old stateful bean and use it with correct selection rule (same for all in current system).

                Problem is that when no-one calls our webservices stateful beans are first moved to disk and then finally removed, and stateless beans above them are not removed. So when next time someone calls our webservices we have stateless bean without underlying data connection because cached bean was removed from disk.

                I tried to set max-bean-age to stateless beans so they would be removed in shorter time it takes stateful beans to be totally removed. Looking from "JBoss 3.0 Deployment and Administration Handbook" it would seem that you can set that data for stateless beans, max-bean-life and remover-period are mentioned as stateful only.

                Perhaps I could set stateful beans max-bean-life to new value so they would never be removed, but I think it is not that good idea.


                [** jboss.xml starts here **]

                <?xml version="1.0" encoding="UTF-8"?>
                <!--
                We want to confirm that these session beans are removed before
                session beans under them are removed.
                -->

                <enterprise-beans>

                <ejb-name>Robocop/repository/RepositoryManagement</ejb-name>
                <configuration-name>Shortlived Stateless SessionBean</configuration-name>


                <ejb-name>Robocop/repository/Repository</ejb-name>
                <configuration-name>Shortlived Stateless SessionBean</configuration-name>

                </enterprise-beans>

                <container-configurations>
                <container-configuration extends = "Standard Stateless SessionBean">
                <container-name>Shortlived Stateless SessionBean</container-name>
                <container-cache-conf>
                <cache-policy-conf>
                <overager-period>120</overager-period>
                <max-bean-age>120</max-bean-age>
                </cache-policy-conf>
                </container-cache-conf>
                </container-configuration>
                </container-configurations>

                • 5. Re: Stateful SB removed under Stateles :(
                  jk.mkiii

                  I can't make attach work so I just paste jboss.xml to end of this message.

                  Case is that I have session bean that is used to save/load data. In create you give selection rule that is used to filter what is shown.

                  New stateless session bean is done because access to our repository is done through webservices and so they do not need their own state.

                  But because I don't want to redo everything I just get that old stateful bean and use it with correct selection rule (same for all in current system).

                  Problem is that when no-one calls our webservices stateful beans are first moved to disk and then finally removed, and stateless beans above them are not removed. So when next time someone calls our webservices we have stateless bean without underlying data connection because cached bean was removed from disk.

                  I tried to set max-bean-age to stateless beans so they would be removed in shorter time it takes stateful beans to be totally removed. Looking from "JBoss 3.0 Deployment and Administration Handbook" it would seem that you can set that data for stateless beans, max-bean-life and remover-period are mentioned as stateful only.

                  Perhaps I could set stateful beans max-bean-life to new value so they would never be removed, but I think it is not that good idea.


                  [** jboss.xml starts here **]

                  <?xml version="1.0" encoding="UTF-8"?>
                  <!--
                  We want to confirm that these session beans are removed before
                  session beans under them are removed.
                  -->

                  <enterprise-beans>

                  <ejb-name>Robocop/repository/RepositoryManagement</ejb-name>
                  <configuration-name>Shortlived Stateless SessionBean</configuration-name>


                  <ejb-name>Robocop/repository/Repository</ejb-name>
                  <configuration-name>Shortlived Stateless SessionBean</configuration-name>

                  </enterprise-beans>

                  <container-configurations>
                  <container-configuration extends = "Standard Stateless SessionBean">
                  <container-name>Shortlived Stateless SessionBean</container-name>
                  <container-cache-conf>
                  <cache-policy-conf>
                  <overager-period>120</overager-period>
                  <max-bean-age>120</max-bean-age>
                  </cache-policy-conf>
                  </container-cache-conf>
                  </container-configuration>
                  </container-configurations>

                  • 6. Re: Stateful SB removed under Stateles :(
                    jk.mkiii

                    I can't make attach work so I just paste jboss.xml to end of this message.

                    Case is that I have session bean that is used to save/load data. In create you give selection rule that is used to filter what is shown.

                    New stateless session bean is done because access to our repository is done through webservices and so they do not need their own state.

                    But because I don't want to redo everything I just get that old stateful bean and use it with correct selection rule (same for all in current system).

                    Problem is that when no-one calls our webservices stateful beans are first moved to disk and then finally removed, and stateless beans above them are not removed. So when next time someone calls our webservices we have stateless bean without underlying data connection because cached bean was removed from disk.

                    I tried to set max-bean-age to stateless beans so they would be removed in shorter time it takes stateful beans to be totally removed. Looking from "JBoss 3.0 Deployment and Administration Handbook" it would seem that you can set that data for stateless beans, max-bean-life and remover-period are mentioned as stateful only.

                    Perhaps I could set stateful beans max-bean-life to new value so they would never be removed, but I think it is not that good idea.


                    [** jboss.xml starts here **]

                    <?xml version="1.0" encoding="UTF-8"?>
                    <!--
                    We want to confirm that these session beans are removed before
                    session beans under them are removed.
                    -->

                    <enterprise-beans>

                    <ejb-name>Robocop/repository/RepositoryManagement</ejb-name>
                    <configuration-name>Shortlived Stateless SessionBean</configuration-name>


                    <ejb-name>Robocop/repository/Repository</ejb-name>
                    <configuration-name>Shortlived Stateless SessionBean</configuration-name>

                    </enterprise-beans>

                    <container-configurations>
                    <container-configuration extends = "Standard Stateless SessionBean">
                    <container-name>Shortlived Stateless SessionBean</container-name>
                    <container-cache-conf>
                    <cache-policy-conf>
                    <overager-period>120</overager-period>
                    <max-bean-age>120</max-bean-age>
                    </cache-policy-conf>
                    </container-cache-conf>
                    </container-configuration>
                    </container-configurations>

                    • 7. Re: Stateful SB removed under Stateles :(
                      jk.mkiii

                      I can't make attach work so I just paste jboss.xml to end of this message.

                      Case is that I have session bean that is used to save/load data. In create you give selection rule that is used to filter what is shown.

                      New stateless session bean is done because access to our repository is done through webservices and so they do not need their own state.

                      But because I don't want to redo everything I just get that old stateful bean and use it with correct selection rule (same for all in current system).

                      Problem is that when no-one calls our webservices stateful beans are first moved to disk and then finally removed, and stateless beans above them are not removed. So when next time someone calls our webservices we have stateless bean without underlying data connection because cached bean was removed from disk.

                      I tried to set max-bean-age to stateless beans so they would be removed in shorter time it takes stateful beans to be totally removed. Looking from "JBoss 3.0 Deployment and Administration Handbook" it would seem that you can set that data for stateless beans, max-bean-life and remover-period are mentioned as stateful only.

                      Perhaps I could set stateful beans max-bean-life to new value so they would never be removed, but I think it is not that good idea.


                      [** jboss.xml starts here **]

                      <?xml version="1.0" encoding="UTF-8"?>
                      <!--
                      We want to confirm that these session beans are removed before
                      session beans under them are removed.
                      -->

                      <enterprise-beans>

                      <ejb-name>Robocop/repository/RepositoryManagement</ejb-name>
                      <configuration-name>Shortlived Stateless SessionBean</configuration-name>


                      <ejb-name>Robocop/repository/Repository</ejb-name>
                      <configuration-name>Shortlived Stateless SessionBean</configuration-name>

                      </enterprise-beans>

                      <container-configurations>
                      <container-configuration extends = "Standard Stateless SessionBean">
                      <container-name>Shortlived Stateless SessionBean</container-name>
                      <container-cache-conf>
                      <cache-policy-conf>
                      <overager-period>120</overager-period>
                      <max-bean-age>120</max-bean-age>
                      </cache-policy-conf>
                      </container-cache-conf>
                      </container-configuration>
                      </container-configurations>

                      • 8. Re: Stateful SB removed under Stateles :(
                        jk.mkiii

                        I can't make attach work so I just paste jboss.xml to end of this message.

                        Case is that I have session bean that is used to save/load data. In create you give selection rule that is used to filter what is shown.

                        New stateless session bean is done because access to our repository is done through webservices and so they do not need their own state.

                        But because I don't want to redo everything I just get that old stateful bean and use it with correct selection rule (same for all in current system).

                        Problem is that when no-one calls our webservices stateful beans are first moved to disk and then finally removed, and stateless beans above them are not removed. So when next time someone calls our webservices we have stateless bean without underlying data connection because cached bean was removed from disk.

                        I tried to set max-bean-age to stateless beans so they would be removed in shorter time it takes stateful beans to be totally removed. Looking from "JBoss 3.0 Deployment and Administration Handbook" it would seem that you can set that data for stateless beans, max-bean-life and remover-period are mentioned as stateful only.

                        Perhaps I could set stateful beans max-bean-life to new value so they would never be removed, but I think it is not that good idea.


                        • 9. Re: Stateful SB removed under Stateles :(
                          jk.mkiii

                          I can't make attach work so I just paste jboss.xml to end of this message.

                          Case is that I have session bean that is used to save/load data. In create you give selection rule that is used to filter what is shown.

                          New stateless session bean is done because access to our repository is done through webservices and so they do not need their own state.

                          But because I don't want to redo everything I just get that old stateful bean and use it with correct selection rule (same for all in current system).

                          Problem is that when no-one calls our webservices stateful beans are first moved to disk and then finally removed, and stateless beans above them are not removed. So when next time someone calls our webservices we have stateless bean without underlying data connection because cached bean was removed from disk.

                          I tried to set max-bean-age to stateless beans so they would be removed in shorter time it takes stateful beans to be totally removed. Looking from "JBoss 3.0 Deployment and Administration Handbook" it would seem that you can set that data for stateless beans, max-bean-life and remover-period are mentioned as stateful only.

                          Perhaps I could set stateful beans max-bean-life to new value so they would never be removed, but I think it is not that good idea.


                          [** jboss.xml starts here **]

                          <?xml version="1.0" encoding="UTF-8"?>
                          <!--
                          We want to confirm that these session beans are removed before
                          session beans under them are removed.
                          -->

                          <enterprise-beans>

                          <ejb-name>Robocop/repository/RepositoryManagement</ejb-name>
                          <configuration-name>Shortlived Stateless SessionBean</configuration-name>


                          <ejb-name>Robocop/repository/Repository</ejb-name>
                          <configuration-name>Shortlived Stateless SessionBean</configuration-name>

                          </enterprise-beans>

                          <container-configurations>
                          <container-configuration extends = "Standard Stateless SessionBean">
                          <container-name>Shortlived Stateless SessionBean</container-name>
                          <container-cache-conf>
                          <cache-policy-conf>
                          <overager-period>120</overager-period>
                          <max-bean-age>120</max-bean-age>
                          </cache-policy-conf>
                          </container-cache-conf>
                          </container-configuration>
                          </container-configurations>

                          • 10. Re: Stateful SB removed under Stateles :(
                            jk.mkiii

                            I can't make attach work so I just paste jboss.xml to end of this message.

                            Case is that I have session bean that is used to save/load data. In create you give selection rule that is used to filter what is shown.

                            New stateless session bean is done because access to our repository is done through webservices and so they do not need their own state.

                            But because I don't want to redo everything I just get that old stateful bean and use it with correct selection rule (same for all in current system).

                            Problem is that when no-one calls our webservices stateful beans are first moved to disk and then finally removed, and stateless beans above them are not removed. So when next time someone calls our webservices we have stateless bean without underlying data connection because cached bean was removed from disk.

                            I tried to set max-bean-age to stateless beans so they would be removed in shorter time it takes stateful beans to be totally removed. Looking from "JBoss 3.0 Deployment and Administration Handbook" it would seem that you can set that data for stateless beans, max-bean-life and remover-period are mentioned as stateful only.

                            Perhaps I could set stateful beans max-bean-life to new value so they would never be removed, but I think it is not that good idea.


                            [** jboss.xml starts here **]

                            <?xml version="1.0" encoding="UTF-8"?>
                            <!--
                            We want to confirm that these session beans are removed before
                            session beans under them are removed.
                            -->

                            <enterprise-beans>

                            <ejb-name>Robocop/repository/RepositoryManagement</ejb-name>
                            <configuration-name>Shortlived Stateless SessionBean</configuration-name>


                            <ejb-name>Robocop/repository/Repository</ejb-name>
                            <configuration-name>Shortlived Stateless SessionBean</configuration-name>

                            </enterprise-beans>

                            <container-configurations>
                            <container-configuration extends = "Standard Stateless SessionBean">
                            <container-name>Shortlived Stateless SessionBean</container-name>
                            <container-cache-conf>
                            <cache-policy-conf>
                            <overager-period>120</overager-period>
                            <max-bean-age>120</max-bean-age>
                            </cache-policy-conf>
                            </container-cache-conf>
                            </container-configuration>
                            </container-configurations>

                            • 11. Re: Stateful SB removed under Stateles :(
                              jk.mkiii

                              I can't make attach work so I just paste jboss.xml to end of this message.

                              Case is that I have session bean that is used to save/load data. In create you give selection rule that is used to filter what is shown.

                              New stateless session bean is done because access to our repository is done through webservices and so they do not need their own state.

                              But because I don't want to redo everything I just get that old stateful bean and use it with correct selection rule (same for all in current system).

                              Problem is that when no-one calls our webservices stateful beans are first moved to disk and then finally removed, and stateless beans above them are not removed. So when next time someone calls our webservices we have stateless bean without underlying data connection because cached bean was removed from disk.

                              I tried to set max-bean-age to stateless beans so they would be removed in shorter time it takes stateful beans to be totally removed. Looking from "JBoss 3.0 Deployment and Administration Handbook" it would seem that you can set that data for stateless beans, max-bean-life and remover-period are mentioned as stateful only.

                              Perhaps I could set stateful beans max-bean-life to new value so they would never be removed, but I think it is not that good idea.


                              [** jboss.xml starts here **]

                              <?xml version="1.0" encoding="UTF-8"?>
                              <!--
                              We want to confirm that these session beans are removed before
                              session beans under them are removed.
                              -->

                              <enterprise-beans>

                              <ejb-name>Robocop/repository/RepositoryManagement</ejb-name>
                              <configuration-name>Shortlived Stateless SessionBean</configuration-name>


                              <ejb-name>Robocop/repository/Repository</ejb-name>
                              <configuration-name>Shortlived Stateless SessionBean</configuration-name>

                              </enterprise-beans>

                              <container-configurations>
                              <container-configuration extends = "Standard Stateless SessionBean">
                              <container-name>Shortlived Stateless SessionBean</container-name>
                              <container-cache-conf>
                              <cache-policy-conf>
                              <overager-period>120</overager-period>
                              <max-bean-age>120</max-bean-age>
                              </cache-policy-conf>
                              </container-cache-conf>
                              </container-configuration>
                              </container-configurations>

                              • 12. Re: Stateful SB removed under Stateles :(
                                jk.mkiii

                                Case is that I have session bean that is used to save/load data. In create you give selection rule that is used to filter what is shown.

                                New stateless session bean is done because access to our repository is done through webservices and so they do not need their own state.

                                But because I don't want to redo everything I just get that old stateful bean and use it with correct selection rule (same for all in current system).

                                Problem is that when no-one calls our webservices stateful beans are first moved to disk and then finally removed, and stateless beans above them are not removed. So when next time someone calls our webservices we have stateless bean without underlying data connection because cached bean was removed from disk.

                                I tried to set max-bean-age to stateless beans so they would be removed in shorter time it takes stateful beans to be totally removed. Looking from "JBoss 3.0 Deployment and Administration Handbook" it would seem that you can set that data for stateless beans, max-bean-life and remover-period are mentioned as stateful only.

                                Perhaps I could set stateful beans max-bean-life to new value so they would never be removed, but I think it is not that good idea.

                                • 13. Re: Stateful SB removed under Stateles :(
                                  jk.mkiii

                                  It seems that I can't reply to this forum ...well testing once more with shorter post :)

                                  • 14. Re: Stateful SB removed under Stateles :(
                                    jonlee

                                    Wouldn't it be better to create an MBean that can provide you with this service? At least it would be better suited to your purpose rather than abusing the poor stateful session beans. You certainly would not have the problem with the service disappearing.

                                    1 2 Previous Next