9 Replies Latest reply on Mar 25, 2014 11:39 AM by ibenjes

    Clustering with pojos

    ibenjes

      Hi

       

      we currently have a web application using Seam 2.3 on JBoss as 7.1. Given the increasing demand on the webapp we foresee the need to move to a clustered environment soonish.

      Currently the whole project is based on pojos rather than EJB3 stateful/statless beans.

       

      I've read somewhere that JBoss AS 7 now supports clustering of pojos but I can't find any information on what actually needs to be done.

      A few links on http://www.jboss.org/jbossclustering don't seem to be working anymore and the link to the official documentation leads to the clustering guide for AS 5.1.

       

      Can anyone point me into the right direction on how to get clustering working with Seam 2.3 pojo's and JBoss AS 7?

      Or will I have to move all my pojos to stateful EJB3 beans?

       

       

      Regards

       

      Immo

        • 1. Re: Clustering with pojos
          wdfink

          POJO's will not be managed by the container, so you have no clustering here.

          But as this is a web application you might loadbalance the webapp direct and use the POJO's local

          • 2. Re: Clustering with pojos
            ibenjes

            Then I don't understand what this extract from http://www.jboss.org/jbossclustering means:

             

            Clustering support for lightweight POJO applications

            JBoss AS was the first application server to support transparent clustering of EJB 3.0 POJOs. It allows you take advantage of the simple new POJO programming model without compromising the superior scalability typically found in traditional J2EE applications. The JBoss AS supports EJB 3.0 entity bean cache clustering, EJB 3.0 stateful session bean clustering, and HTTP clustering out of the box. Check out a guided tour through a live web application to learn how to configure clustering for EJB 3.0 web applications

            • 3. Re: Clustering with pojos
              wdfink

              EJB 30 POJO's mean the new programming model of EE5, use simple POJO's and add the annotation Stateless Statefull ...

              in this case you have EJB3 stateless or statefull session beans which are supported.

               

              That does not mean simple unmangede POJO's

              • 4. Re: Clustering with pojos
                ibenjes

                Okay I got a bit confused there. I come from a Seam background where Seam components can be either POJOs or EJBs beans and EJBs don't give you many extra features that Seam Pojos don't have. Clustering seems to be the big one though.

                • 5. Re: Clustering with pojos
                  ibenjes

                  Actually I just found this: https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Web_Platform/5/html/Seam_Reference_Guide/ClusteringAndEJBPassivation.html

                  Which seems to suggest that Seam Pojos can be clustered:

                  ... Monitoring and replicating stateful EJB components is already handled by the EJB server; Seam state management provides the same feature for stateful JavaBeans.

                  33.1.1. Programming for clustering

                   

                  Any session- or converation-scoped mutable JavaBean component to be used in a clustered environment must implement the org.jboss.seam.core.Mutable interface from the Seam API. As part of the contract, the component must maintain a dirtyflagevent, which indicates whether the user has made changes to the form that must be saved. This event is reported and reset by the clearDirty() method, which is called to determine whether the component must be replicated. This lets you avoid using the Servlet API to add and remove the session attribute for every change to an object.

                  You must also make sure that all session- and conversation-scoped JavaBean components are serializable. All fields of a stateful component (EJB or JavaBean) must be serializable, unless marked transient or set to null in a @PrePassivate method. You can restore the value of a transient or nullified field in a @PostActivate method.

                  • 6. Re: Clustering with pojos
                    rhusar

                    A few links on http://www.jboss.org/jbossclustering don't seem to be working anymore and the link to the official documentation leads to the clustering guide for AS 5.1.

                    Well, this project is deprecated and not used in AS 7. I realize this is not written anywhere. Clustering code now resides in the AS codebase itself.

                     

                    Can anyone point me into the right direction on how to get clustering working with Seam 2.3 pojo's and JBoss AS 7?

                    Does following Seam - Contextual Components help?

                     

                    Or will I have to move all my pojos to stateful EJB3 beans?

                    That would probably be the most reasnable approach, since Seam is not moving forward any more.

                    • 7. Re: Clustering with pojos
                      ibenjes

                      Thanks for the link Radoslav.

                       

                      Radoslav Husar wrote:

                      Or will I have to move all my pojos to stateful EJB3 beans?

                      That would probably be the most reasnable approach, since Seam is not moving forward any more.

                      That is the problem with large legacy projects. It took me 2 month just to port the app from Seam 2.2 + JSF 1.2 to Seam 2.3 and JSF 2.

                      At some point I would like to move the project to CDI or DeltaSpike but the move to Seam 2.3 gave us a bit of breathing space for now.

                      • 8. Re: Clustering with pojos
                        rhusar

                         

                        Radoslav Husar wrote:

                        Or will I have to move all my pojos to stateful EJB3 beans?

                        That would probably be the most reasnable approach, since Seam is not moving forward any more.

                        That is the problem with large legacy projects. It took me 2 month just to port the app from Seam 2.2 + JSF 1.2 to Seam 2.3 and JSF 2.

                        At some point I would like to move the project to CDI or DeltaSpike but the move to Seam 2.3 gave us a bit of breathing space for now.

                        I hear you. Well, kudos for moving both versions, the JSF part you will be able to keep around for a while. Out of curiosity, if you were to migrate to use CDI and EJB 3.1, what are the missing pieces that you are currently using in Seam but are not available in EE (i.e. which parts of deltaspike do you need to pull in)?

                        • 9. Re: Clustering with pojos
                          ibenjes

                          Radoslav Husar wrote:

                           

                           

                          Radoslav Husar wrote:

                          Or will I have to move all my pojos to stateful EJB3 beans?

                          That would probably be the most reasnable approach, since Seam is not moving forward any more.

                          That is the problem with large legacy projects. It took me 2 month just to port the app from Seam 2.2 + JSF 1.2 to Seam 2.3 and JSF 2.

                          At some point I would like to move the project to CDI or DeltaSpike but the move to Seam 2.3 gave us a bit of breathing space for now.

                          I hear you. Well, kudos for moving both versions, the JSF part you will be able to keep around for a while. Out of curiosity, if you were to migrate to use CDI and EJB 3.1, what are the missing pieces that you are currently using in Seam but are not available in EE (i.e. which parts of deltaspike do you need to pull in)?

                          The missing pieces are our resources ;-) I haven't looked into it yet but we use Seam mail, some page caching, permissions etc. in most parts CDI will probably be enough.