9 Replies Latest reply on Aug 31, 2003 12:57 AM by Sacha Labourey

    Sticky EJB ?????

    mikebaroukh Newbie

      Hi all.

      Does anybody knows how to make a Statefull EJB sticky with the application server on wich it was created ?

      I'm using this EJB on a 3 server cluster. I overriden "isModified()" to always return true. This way, there is no context replication on each method call but calls to EJB are still load-balanced.

      The reason for this is that to an EJB is asociated a tcp socket connection and it will never (I think ???) can be replicated ....

      Actually, I can see that, sometimes, calls to the EJB are made on another server. I don't understand why but it seem to append at most twice / ejb.

      Finally, to be simple, I wan't load-balancing and fail-over for EJB Creation, but not for EJB Calls ....

      Any help will be appreciated.

      Thanks in Advance.

      Mike Baroukh

        • 1. Re: Sticky EJB ?????
          mikebaroukh Newbie

          I forgot to say : I use JBoss v3.2.1 ....

          • 2. Re: Sticky EJB ?????
            Uijin Hong Newbie

            > Finally, to be simple, I wan't load-balancing and fail-over for EJB Creation, but not for EJB Calls ....

            I hope this could help

            AFAIK,

            Check the JBoss-specific EJB deplyment decriptor (jboss.xml) and remove "". Then there is no clustering.

            Just deploy thoses EJBs to multiple node. Then you get load-balancing.

            • 3. Re: Sticky EJB ?????
              mikebaroukh Newbie

              Hi.

              Thanks for your reply.

              Unfortunatly, it doesn't match : when I remove "", EJB creation is not load-balanced.
              So all ejbs are created on the first application server and the second application server is iddle.
              If I stop the first one, the second application server take the hand.

              For your information, I start jboss with "-c all" becuase I have others *real* ejb that are fully load-balanced/fail-over ...

              Any other suggestion ?

              Mike

              • 4. Re: Sticky EJB ?????
                Uijin Hong Newbie

                > Unfortunatly, it doesn't match : when I remove
                > "", EJB creation is not load-balanced.
                > So all ejbs are created on the first application
                > server and the second application server is iddle.
                > If I stop the first one, the second application
                > server take the hand.

                Oh, I see. It seems like your EJB is not cluster-able (cause of that non-cluster-able Socket resource). So I though just deploying it to all node without "" tags, unless you have some custome built Home interface.

                • 5. Re: Sticky EJB ?????
                  Uijin Hong Newbie

                  And, why don't you try just fecthing Home Inerface at the random machine, by putting some code to set InitialContext's Properties. Even though this couldn't be possible when all nodes has same IP address/DNS anme to EJB cluster side.

                  • 6. Re: Sticky EJB ?????
                    mikebaroukh Newbie

                    I thought to it but the problem is that, by using a real cluster, I can had/remove machines without having to add/remove their address in the client's InitialContext ...

                    ... and the cluster is made for this. Maybe what I wan't is just a configuration issue or maybe it's a feature that would be nice to have ...

                    Thanks again

                    Mike

                    • 7. Re: Sticky EJB ?????
                      Sacha Labourey Master

                      what do you REALLY want? if you only want HA-JNDI, fine, you don't need to cluster your SFSB then.

                      BTW, if you set isMODIFIED to always return true, it will ALWAYS REPLICATE the state, not never as mentionned in your first post.

                      Plus, calls to the same SFSB NEVER load-balance by default, they are sticky to the host on which they are created.

                      Please read the clustering doco.

                      Cheers,


                      sacha

                      • 8. Re: Sticky EJB ?????
                        mikebaroukh Newbie

                        Hi Sacha.

                        Yes I wan't HA-JNDI but with a load-balance on EJBs creations. Also, I wan't a cluster because I want to be able to add an new machine in the cluster and have it automatically be used.

                        For isModified(), I made a typo error : Of course I told it to always return false.

                        I'm absolutly sure that EJBs are NOT absolutly sticky : After the creation, the first call is not always made on the server it was created next calls are sticky ...

                        I have all docs including clustering one and it's not clear.
                        For example, if isModified() always return false including after construction, in wich state will be the bean in the cluster ?

                        Mike

                        • 9. Re: Sticky EJB ?????
                          Sacha Labourey Master

                          Please add these issues/questions to a bug or feature request on sf.net and assign that to slaboure

                          thanks. sacha