4 Replies Latest reply on Aug 16, 2010 4:56 AM by robert.geisler

    On-Demand Deployment of EJBs?

    robert.geisler Newbie

      hallo...

       

      i read about 'On-Demand Deployment of WebApplications' and had a look at the on-demand deployment of jmx- and admin-console. that is a great feature. now i wonder if there is such a 'on-demand deployment' for EJBs, too?

      i would like JBoss to wait for loading Entity-, SessionBean-, ... classes untill the first usage of such classes (client request, server process) instead of loading classes and creating instances while deploying my EAR (includes > 100 EJB Module JARs). this 'lazy initialisation' could save much ressources and speed up JBoss boot time.

      is it possible to configure on-demand deployment for EJBs in JBoss 6.0.0 M3? will it be possible in later milestone releases?

       

      thanks in advance

      regards

      robert

        • 1. Re: On-Demand Deployment of EJBs?
          jaikiran pai Master

          Robert Geisler wrote:

           


          i would like JBoss to wait for loading Entity-, SessionBean-, ... classes untill the first usage of such classes (client request, server process) instead of loading classes and creating instances while deploying my EAR (includes > 100 EJB Module JARs). this 'lazy initialisation' could save much ressources and speed up JBoss boot time.

          JBoss EJB3 doesn't create instances of beans unless some client access those beans.

          • 2. Re: On-Demand Deployment of EJBs?
            robert.geisler Newbie

            hi jaikiran...

             

            of course you are right, my explanation was wrong.

            creating bean instances was not what i actually meant... i meant all the initializations JBoss does WHILE deploying EJBs, but BEFORE accessing EJBs by clients.

             

            i do not know what JBoss does in detail while deploying (for sure some annotation and xml parsing, wrapper instance creation,...), but to me it seems as JBoss prepares every EJB on deployment (environment, dependencies,...) and just creates instances and call business methods on accessing by clients.

            but i would love to configure JBoss to not initialize/ prepare anything on deployment, but on first access, right before first access. how does that work for WARs? there seems to be almost no initialization on startup for the various consoles...? JBoss seems to not deploy the WARs until first access by a client (e.g. browsers)... ? is there no chance to get this work for EJBs, too??

             

            i remember i read about such a 'deployment on demand of EJBs' long time ago, but today i can not find that again.

             

            thanks anyway.

             

            regards

            robert

            • 3. Re: On-Demand Deployment of EJBs?
              jaikiran pai Master

              Robert Geisler wrote:

               

              hi jaikiran...

               

              i do not know what JBoss does in detail while deploying (for sure some annotation and xml parsing, wrapper instance creation,...), but to me it seems as JBoss prepares every EJB on deployment (environment, dependencies,...) and just creates instances and call business methods on accessing by clients.

              but i would love to configure JBoss to not initialize/ prepare anything on deployment, but on first access, right before first access.

              There's no option for that. Also note that pushing such initialization to first access is going to give terrible performance issue for the first client. Also if there are any deployment issues, then until the first client accesses the app, those won't be uncovered.

               

              Robert Geisler wrote:

               

              how does that work for WARs? there seems to be almost no initialization on startup for the various consoles...? JBoss seems to not deploy the WARs until first access by a client (e.g. browsers)... ?

              See this thread for the details http://community.jboss.org/thread/147220. Also remember that the first access of admin-console is real slow.

               

              Robert Geisler wrote:

               

              i remember i read about such a 'deployment on demand of EJBs' long time ago, but today i can not find that again.

               

              Are you sure it was on-demand deployment and not @Startup for @Singleton beans?

              • 4. Re: On-Demand Deployment of EJBs?
                robert.geisler Newbie

                thank you, jaikiran...

                 

                you may be right that initialization on first access will be bad performance for the first client. although it could speed up JBoss boot time, especially for developing purposes. but due to the fact that

                jaikiran pai schrieb:


                There's no option for that.

                i give up that 'project' and reject my questions O: )

                jaikiran pai schrieb:

                Robert Geisler wrote:

                 

                i remember i read about such a 'deployment on demand of EJBs' long time ago, but today i can not find that again.

                Are you sure it was on-demand deployment and not @Startup for @Singleton beans?

                now i actually doubt that it was 'on-demand deployment' i read about.

                feel free to forget my statement, because i am not able to reproduce it today.

                 

                anyway... thank you very much!

                robert