updating blob field oracle with hibernate results in > 4000 bytes error

Ok so writing BLOB fields in Oracle (with hibernate) could give you a bla bla length > 4000 bytes error. [todo: lookup exact error] First of all I’ll explain why. The BLOB fields in oracle work with a pointer and that pointer is 4000 bytes. The actual data is stored elsewhere. So your problem is that you’re trying to write to this pointer instead. [todo: lookup source]

I believe (didn’t have time to test yet [todo]) that the problem is within the driver. So first of all get the latest driver you can get.

oracle jdbc driver version


com.oracle.jdbc
jdbc-thin
1.2
test

The following information is for completeness only.

hibernate version


org.hibernate
hibernate
3.2.0.ga

hibernate mapping

<property name=“xml” lazy=“true” not-null=“true” column=“xml” />

java property

/**
* xml data of this audit
*/
private byte[] xml;

public byte[] getXml() {
return xml;
}

public void setXml(byte[] xml) {
this.xml = xml;
}

column definition

XML BLOB not null

Leave a Reply

Your email address will not be published. Required fields are marked *

Please reload

Please Wait