1 Reply Latest reply on Feb 4, 2013 8:07 AM by jharting

    Clustering an application which uses CDI Beans

    mylos78

      Dear all,

      I'm running a Java EE 6 application which uses CDI Beans and a @SessionScoped Bean to keep track of the user's session. Now I have the need to deploy this application in cluster made up of JBoss AS 7.1.1 nodes. My doubt is: in order to achieve HA of my session, is it enough that I tag my SessionScoped bean as @Clusterable ?

      @Named

      @ConversationScoped

      @Clustered

      public class SessionDriver implements Serializable {

      . . . .

      }

      or should I mark as @Clustered also other @Model beans which are used by the application, such as the Bean which starts the Conversation ?

      @Model

      @Clustered // ????

      public class Controller {

      @Inject

      private Conversation conversation;

       

      public String create() {

       

             . . . . .

              conversation.begin();

            . . . . .

      }

      public String endConv() {

       

             . . . . .

              conversation.end();

            . . . . .

      }

      }

      Thanks

      Mylos