3 Replies Latest reply on Nov 29, 2006 10:17 PM by Elias Ross

    Updating the data model for a distributed cache

    Jorge Morales Newbie

      Hi,
      I have the following scenario:
      I have a distributed cache across 2 nodes. I want to update de data model of the objets stored in this cache, but I can´t stop both nodes to do the update at the same time, so I have to restart first one node, and then the other node.
      The problem is, when I restart the first node, with the updated data model, will there be a clash in the data replication (assuming diferent serialUIDs for the objects)?

      Thanks,

        • 1. Re: Updating the data model for a distributed cache
          Manik Surtani Master

          I don't quite understand what you mean by an updated data model, but perhaps using cache regions and activation may help you. Docs on Regions and activation/inactivation may be useful.

          • 2. Re: Updating the data model for a distributed cache
            Jorge Morales Newbie

            I´ll extend further on my question.

            I have a class:

            public class User implements Serializable{
             private static final long serialVersionUID = 1L;
             private String name;
             private String password;
             ...
             // getters and setters ommited
            }
            


            This class is in my clustered cache.

            Now I want to update my class to this:
            public class User implements Serializable{
             private static final long serialVersionUID = 2L;
             private String name;
             private String password;
             private String email;
             ...
             // getters and setters ommited
            }
            


            Which is not compatible with my previous class.

            Now, I want to do the update in such a way that my clustered app don´t loose service, so I shutdown node A, update class, start node A. Shutdown node B, update class, start node B.

            My question is, what can happen if I do this, because of the incompatible classes?

            Can I inactivate region where this classes are stored. To the updates and activate the region again? Then if there are updates in the cache while any of the nodes is down, what will it happen?

            Thanks,

            • 3. Re: Updating the data model for a distributed cache
              Elias Ross Master

              I believe the answer is yes, if Java on cache 1 can deserialize the value from cache 2. It's almost trivial to experiment yourself.