Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-3398

SessionInfo does not store entity references correctly

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: jBPM 5.1
    • Fix Version/s: jBPM 5.2
    • Component/s: Runtime Engine
    • Labels:
      None
    • Environment:

      Windows 7 Enterprise 64-bit, jBPM5.1

    • Steps to Reproduce:
      Hide

      Create a process with Human Task (that does not complete) and variables (with @Entity annotation but without Serializable). Start process (such that process is active), and then call ksession.dispose().

      Show
      Create a process with Human Task (that does not complete) and variables (with @Entity annotation but without Serializable). Start process (such that process is active), and then call ksession.dispose().

      Description

      While implementing my own persistency solution (I'm using a custom ORM that is not JPA-compliant), I have spotted an error while storing SessionInfo into database (I'm using persistence strategy to store session and process instance info into a database).
      The error was like this:
      java.io.NotSerializableException: hr.mnorsic.test.bo.SomeClass

      At first, it seems that my class does not implement java.io.Serializable. But I was curious to see why I have to implement Serializable, because my persistence strategy already knows that it is stored into a database, and only needs to fetch instance Id and store it into a database (I did it the similar way as in JPAPlaceholderResolverStrategy)?
      Deloving more deeply into a jBPM code, it seems that RuleFlowProcessInstance is not properly persisted (because subContextInstance contains these objects), because it stores the whole object, insted of storing object references only.
      And as a consequence, we have two object instances: one stored into a ProcessInstance (only a reference to an object) and one in SessionInfo (as a serialized object).

      The solution is one of the following:
      1. custom serialization strategy for RuleFlowProcessInstance (for subContextInstance map), or
      2. custom Map implementation that uses custom serialization strategy (both approaches should use object marshalling strategy for each object in a Map)

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  marco.rietveld Marco Rietveld
                  Reporter:
                  mnorsic Miljenko Norsic
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: