Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Some analysis of JBPM indicates that binary data may be split across multiple records. This may not be the case for mysql itself, but the JPBM code is written to support multiple RDBMs, and some have limits on the size of binary records.</p> <p>Since the question earned me a tumbleweed reward, I was not going to get a usable mysql-based answer in within the deadline I had to meet, so I re-considered the core problem and the operating context the problem occurs, and came up with a solution that avoided the needed to perform direct mysql operations.</p> <p>The main application in question already has some customize modifications to JBPM, so the solution I implemented altered JBPM source which performs the deserialization of process instance variables. This avoids the need to deal with JBPM logic that extracts the deserialized binary data from the RDBMs.</p> <p>In the class <code>org.jbpm.context.exe.converter.SerializableToByteArrayConverter</code>, I modifed the code to use a custom <code>ObjectInputStream</code> class that returns the latest SUID of a class. The technique of just replacing the descriptor with the latest version of the class as described in the post referenced in the question does not work if the new class includes new fields. Doing so causes an end-of-data exception since the base deserialization code tries to access the "new" fields in the old, deserialized version of the class.</p> <p>Therefore, I just need to replace the SUID, but keep all other parts of the descriptor the same. Since the JDK does not make <code>ObjectStreamClass</code> extensible, I created a sub-class of <code>ObjectInputStream</code> that returns the new SUID based upon a given calling pattern the java library executes against <code>ObjectInputStream</code> when deserialzing data.</p> <p>The pattern: When reading the header of a deserialized object, the <code>readUTF()</code> function is called (to obtain the class name) followed by a <code>readLong()</code> call. Therefore, if this calling sequence occurs, and if the <code>readUTF()</code> returned the class name I want to change the SUID of, I return the newer SUID in the <code>readLong()</code> call.</p> <p>The custom code reads a configuration file that specifies class names and associated SUIDs that should be mapped to the latest SUIDs for the classes listed. This allows mapping of alternate classes in the future w/o modifying the custom code.</p> <p>Note, this approach is applicable to general deserialization operations, where one needs to map old SUIDs to the latest SUIDs of specified classes, and leaving the other parts of the serialized class descriptor alone to avoid end-of-data problems if the newer class definition includes additional field declarations not present in the older class definition.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload