Details

      Description

      Hi,

      The java.io.ObjectOutputStream API specifies that: "Multiple references to a single object are encoded using a reference sharing mechanism so that graphs of objects can be restored to the same shape as when the original was written. "

      Let's say that a knowledge session contains one fact. We serialize the knowledge session and the fact into one output stream. Then deserialize the session and the fact. The object references will be different. In my opinion this is a bug.

      Attached is a unit test to show this.

      Example use case:
      This can happen for example if the stateful knowledge session is stored within a HTTP servlet session. The HTTP servlet session can contain other objects that are part of the stateful knowledge session. When the HTTP servlet session is serialized and deserialized the object references will be different and it is for example no longer possible to do session.getFactHandleByIdentity(...).

      Please note that this issue might be fixed by fixing JBRULES-1925.

      Thank you.
      Best Regards,
      Michal

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mark.proctor Mark Proctor
                Reporter:
                michalbali Michal Bali
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: