Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Deserialization of BLOB returning NULL  RSS feed

 
Dave Schick
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm storing a serialized object graph on a DB2 table into a column of type BLOB. I can successfully retrieve this column into java as a byte[]. But when I try to deserialize it, it comes back NULL. If I take DB2 out of the picture (ie, run a test where I serialize the object graph then turn around and deserialize it) - it works fine.

barr = (byte[])ngrfRequestWipDao.read(ngrfRequestWipTO);
// Deserialize object graph
ObjectInputStream in = new ObjectInputStream(
new ByteArrayInputStream(barr));
// Deserialize the object
mainRequest = (MainRequestIface) in.readObject();

...mainRequest is NULL at this point.

Any insight you can provide would be greatly appreciated. Thanks!
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like the byte[] contains the serialized value for null. My guess is the picture isn't stored properly in the database.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!