-
Bug
-
Resolution: Done
-
Major
-
jBPM 5.1
-
None
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)
- relates to
-
JBPM-3431 Serializable class variables are stored in the database twice
- Resolved