Uploaded image for project: 'Commons JCS'
  1. Commons JCS
  2. JCS-82

Lateral Cache does not work with multiple writes to same object: OOS does not get reset

    XMLWordPrintableJSON

Details

    Description

      In a Lateral cache environment, If a mutable object is written to JCS multiple times, only original copy is written every time by ObjectOutputStream of LateralTCPSender.
      This seems to be a known issue as per some forums, but not fixed since it could not be replicated.

      My case is as follows: Server A & B has a common mutable object (say StringBuffer) in cache.
      JDK1.6 Server A:
      StringBuffer obj=new StringBuffer("Initial");
      jcs.put("key",obj);//This is visible to Server B
      obj.append("Append");
      jcs.put("key",obj);//This gets ignored, B still sees obj="Initial"

      I recompiled with LateralTCPSender.RESET_FREQUENCY from 70 to 1, it works fine.

      I suggest, either RESET_FREQUENCY should be 1 or use oos.writeUnshared.

      Attachments

        Issue Links

          Activity

            People

              asmuts Aaron Smuts
              nikunj_trivedi Nikunj Trivedi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: