Hibernate + Oracle + Blob = bug
I've just recently start to use Hibernate session's merge method. Who would have thought that it has a major bug on session merging hibernate object that has blob field?
i.e. for the following hibernate class:
@Entity
@Table("table")
public class MyClass{
@Lob
@Column(name="a_column")
private Blob aBlobColumn;
}
when you assign 'aBlobColumn' a value, and do session merge, the returned object will have aBlobColumn as null. That is bizarre. The same wont happen if you do the normal session save followed by session.get....
Apparently it is a known bug, dating from 2004 (or maybe before that!!).... 5 years ... and they havent fixed it... sigh......
Well.. of course there's a workaround.... which is quite stupid.... just populate the returned object with whatever you save..... but that is... ugly......... and what if the value has been nulled in the first place (in the database) ?.... that is going to screw things....
(you can argue , to have row versioning.... but you cant argue that it is a bug)..

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home