I'm trying to save a blob I created from Hibernate.createBlob(InputStream). The db is currently mysql.
I get:
java.lang.ClassCastException
at net.sf.hibernate.type.BinaryType.deepCopyNotNull(BinaryType.java:89)
at net.sf.hibernate.type.NullableType.deepCopy(NullableType.java:89)
at net.sf.hibernate.type.TypeFactory.deepCopy(TypeFactory.java:198)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:712)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:605)
I'm guessing this is because BinaryType.deepCopyNotNull() expects to be able to copy the byte[] from blob, whilst I'm assuming that the blob only has the InputStream.
There's a similar problem described at
http://forum.hibernate.org/viewtopic.php?t=924398, but none of the replies seem to fit the bill.
Help!