7 Replies Latest reply on May 21, 2006 6:52 AM by Gilad Shriki

    Using JBoss cache to replicate object between machines

    Gilad Shriki Newbie

      Hi there.

      I'm trying to replicate java objects between two machines, using JBoss Cache. The object is pretty simple one.
      The strange thing is that the first time I?m inserting the object with putObject, it is duplicated in to the other machine, but when I?m updating it, the cache does not intercept the changes, and I?m still have the original values in the second machine.

      The scenario:
      1. Machine A and machine B starts and sets up a cluster between them.
      2. Machine A creates an object and inserts it to the cache (putObject).
      3. Machine B prints the values of the object.
      4. Machine A updates the values of the object
      5. Machine B prints the values of the object

      The results are that in 3 and 5, machine B prints same values (the original values).

      Am I missing something?

      Help is appreciated?

      Gilad.

      The object:

      public class Node implements Serializable {
       private static final long serialVersionUID = 1L;
       protected String pStr1;
       protected String pStr2;
       protected int pNumber;
      
       public String getPStr1() {return pStr1;}
       public void setPStr1(String str1) {this.pStr1 = str1;}
       public String getPStr2() {return pStr2;}
       public int getPNumber() {return pNumber;}
       public void setPStr2(String str2) {this.pStr2 = str2;}
       public void setPNumber(int num) {this.pNumber = num;}
      
       public Node(String s1,String s2,int num)
       {
       pStr1 = s1;
       pStr2 = s2;
       pNumber = num;
       }
      }