We have a requirement where we need to store java.util.Set in a graph node (where Rule is a complex business rule object). Since, node.setProperty(..., ...) doesn't allow complex objects, we have serialized the above Set and converted it to byte array and stored it as node.setProperty("rules",serialize("rules")) (2nd argument is a bytearray)
2.The above code works properly when we use EmbeddedGraphDatabase class. In this case, node.getProperty ("rules") returns us a byte array. We get the bytearray and deserialize it to retrieve our Set . (This works fine)
But, when we use RestGraphDatabase class, node.getProperty("rules") returns us a String representation instead of a byte array. Is this expected ? Next, we tried to convert the String to byte array using String.getBytes()
But, when we pass the bytearray to an ObjectInputStream to deserialize, we get "StreamCorruptedException: Invalid Stream Header".
We are looking for different alternatives to fix this . Need your help.
We are facing issue for the below scenario.
2.The above code works properly when we use EmbeddedGraphDatabase class. In this case, node.getProperty ("rules") returns us a byte array. We get the bytearray and deserialize it to retrieve our Set . (This works fine)
We are looking for different alternatives to fix this . Need your help.