8 Replies Latest reply on Jan 29, 2006 5:21 AM by asaf zinger

    session cache

    asaf zinger Newbie

      I have 2 jboss servers .
      I wrote simple web application that put some attribute on the session , read it from the session and show it.

      I'm using mod_jk for lb without sticky session.

      I can see the treeCach is being changed and Its looks the same on both servers but after I updated some session attribute and saw that the session was updated on both treeCache (on both servers) the output on both servers is diffrent it looks like the session is not being read from the treeCache but from the local session

      anyone got idea why is this happening?

      when i'm using sticky session and shut one server the resault is not consistent: some times the resault is the same as the other server and most of the time is different

        • 1. Re: session cache
          asaf zinger Newbie

          I noticed that when I'm using sticky session (I'm directed to only one server) and than shutdown this server than the Session is replicated to the other server and I can see my attritute.
          but after the first time I'm using each session the resault I'm getting is from the local HttpSession and not from the TreeCache (I can see that the Session is being replicated but when i'm using el {user.name} i'm getting diffrent resault from each server)


          • 2. Re: session cache
            asaf zinger Newbie

            someone can help me with this problem.

            When is the local HttpSession is being use and When the TreeCache Session is being used?

            I think that this is my problem (maybe related to Transaction)

            • 3. Re: session cache
              Brian Stansberry Master

              When you change a session and it replicates from node A to node B, if there is a local copy of the session on B it is marked as being out of sync with the TreeCache. The next time you access the local session on B the Manager will update it from the data in the cache before making it available to the request.

              How quickly are you switching between servers? By default asynchronous replication is used; if you switch very quickly between servers (e.g. a programmatic test rather than human use of a browser) your request to server B can arrive before the replicated session.

              What's making you think this is related to transactions? Are you starting transactions during the request that aren't committed or rolledback before the request returns?

              • 4. Re: session cache
                asaf zinger Newbie

                I'm using the browser to move from one server to the other (with mod_jk lb).
                It's look like the treeCahe is sync in both servers(when being watched from the jmx-console) but the resault that i'm getting is diffrent in each server. this is why I think it must get the session localy and not from the treeCache.

                about the transactions I'm not starting one, but saw in the log that the sync is being done in a transaction. I'm not sure that this is related to the problem.

                I'm using jboss-4.0.1 and changed the jboss-cache.jar from version 1.2 to

                • 5. Re: session cache
                  asaf zinger Newbie

                  I'm still having this problem.
                  in ejb the state is replicate fine (but it doesnt use treeCache)

                  but in the web the HttpSession is look like being replicated but the attributes im getting from the session are different in each server.

                  I cannot use jboss Cluster like this and this is a big problem for me


                  • 6. Re: session cache
                    Brian Stansberry Master

                    Can you try it with 4.0.3SP1?

                    • 7. Re: session cache
                      asaf zinger Newbie

                      i'll try it in sunday

                      • 8. Re: session cache
                        asaf zinger Newbie

                        I deployed the same application on jboss-4.0.3sp1 and it's work fine

                        so the problem is only in 4.0.1

                        do you have any idea why?