Java 6 introduced a change to java.sql.Blob which introduced two new methods to the Blob interface. This breaks backward compatibility with code outside the system which either implement the interface or, as in the case encountered, a class which implemnts the interface and wraps an existing implementation in a constructor and then forwards calls to an existing implementation. I.e.
MyBlob implements java.sql.Blob
{
Blob blob;
public MyBlob( Object obj ) {
Object transformedObject = dosomething( obj );
blob = new SerialBlob( transformedObject );
}
void free() {
blob.free();
}
etc...
}
This makes it impossible to produce code that will work on both Java 5 and 6 without resorting to reflection to determine as to whether the target (SerialBlob in this case) contains the new methods (free() and getBinaryStrem( long, long)) This issue is not raised in the compatibility release notes for Java SE6.
MyBlob implements java.sql.Blob
{
Blob blob;
public MyBlob( Object obj ) {
Object transformedObject = dosomething( obj );
blob = new SerialBlob( transformedObject );
}
void free() {
blob.free();
}
etc...
}
This makes it impossible to produce code that will work on both Java 5 and 6 without resorting to reflection to determine as to whether the target (SerialBlob in this case) contains the new methods (free() and getBinaryStrem( long, long)) This issue is not raised in the compatibility release notes for Java SE6.