0 Replies Latest reply on Sep 20, 2013 9:21 AM by Michael Holtzman

    Change or replace a generic serialized context variable with a hibernate mapped variable ?

    Michael Holtzman Newbie

      Hi all. We have a significant jBPM application where we added our own custom variable classes which are serialized and stored in jbpm_byteblock. The jbpm_byteblock table tends to become huge over time (it is blocked at 1K per record).

       

      We would now like to change these variable classes to a hibernate-mapped table, but we need to preserve the values of existing variables in the byteblock table. Is this possible?

       

      Would something like this work?

       

      Create a new class with a corresponding table and hbm.xml file

      Write some code to 'walk' the jbpm_bytearray table to retrieve and deserialize the original variables

      Instantiate these variables as the new class and save it back to the database using the hibernate mapping

      Update the jbpm_variableinstance entry for each variable

      Delete the jbpm_bytearray record

       

      Or am I dreaming? I'm sure I omitted some important details here.

       

      Another thought: Could the constructor for the new class check to see if there is a corresponding value in the old class (jbpm_bytearray) ? If a value exists, use its properties to instantiate the new class and then delete the original variable from the process instance. This would incur some overhead, but seems fairly straightforward and more reliable.

       

      Any thoughts / ideas / etc. would be appreciated.

       

      Thanx.

       

      == Mike