Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-2048

object references are not shared when deserialized

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

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

      Attachments

        Activity

          People

            mproctor@redhat.com Mark Proctor
            michalbali_jira Michal Bali (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Archived:

              PagerDuty