> > return (Game) new ObjectInputStream(
> > new ByteArrayInputStream(byteArray)).readObject();
[quoted text clipped - 3 lines]
> restart server it will retrieve objects okay for a
> while then fall over
err like when the object got too big!
> seemingly without reason!
or so it seemed!
Okay, a bit embarrassing but it won't hurt to make this googlable.
MySQL Blob is 2 + 2^16 bytes tops
So if you put more than that in it ceases to represent a Java Object!!
Moral - your used to seeing odd exceptions when things go wrong and get used
to assuming they result from a very confused serialisation mechanism - don't
rule out the obvious - EOF meant just that!!
--
Mike W
Chris Uppal - 31 Jan 2006 11:41 GMT
> MySQL Blob is 2 + 2^16 bytes tops
> So if you put more than that in it ceases to represent a Java Object!!
Surprising that MySQL didn't report errors when you attempted to store a
byte-stream which was longer than the maximum.
Am I misunderstanding you or is MySQL just broken in this respect ?
-- chris
VisionSet - 31 Jan 2006 15:03 GMT
> > MySQL Blob is 2 + 2^16 bytes tops
> > So if you put more than that in it ceases to represent a Java Object!!
[quoted text clipped - 3 lines]
>
> Am I misunderstanding you or is MySQL just broken in this respect ?
I do a
PreparedStatement.setObject(colNum, myByteArray);
on behalf of an SQL update.
It never throws an SQLException, I only know about it when I manually
deserialise.
Yes it would be nice if it did that, it might give a warning, I don't think
they materialise as SQLExceptions, there probably is some API I can use to
check warnings, but I don't.
--
Mike W