3 Replies Latest reply on May 9, 2009 8:28 AM by nbelaevski

    Singleton managed-bean

      Hi,
      I would like to make one managed-bean as singleton. I hope by making scope Application, it becomes singleton? Currently the scope is session. It has some properties needs to be loaded once from DB and cached. Is there any other way to achieve this?

        • 1. Re: Singleton managed-bean

          As far as I know, setting scope to Application will force one copy of the bean. However, it wont get initialized before the first time it is called IIRC.

          • 2. Re: Singleton managed-bean

            Ok, is there any way to initialize the bean during start up. The problem now for the first time the page loading take lots of time. Also any work around? page loading takes lots of time for the

            • 3. Re: Singleton managed-bean
              nbelaevski

              Hi,

              Use either javax.servlet.ServletContextListener and put your bean into application scope manually or org.jboss.seam.annotations.Startup (available in Seam).