[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4635?page=c...
]
Reinier commented on HHH-4635:
------------------------------
Running into the same issue here...
Situation: Hibernate version 3.6.0.Final and an Oracle 10 database (Character set: utf-8).
One table with both a clob column and a varchar2(4000 char) column.
Analysis: When I insert a string with a length of 4000 into the clob column and not the
varchar column everything works fine. The other way around as well. When inserting data in
both the varchar2 and the clob columns (2 strings with a length of 4000) the following
error occurs: ORA-24816: Expanded non LONG bind data supplied after actual LONG or LOB
column. And to make this behaviour even weirder, when I substring the value of the clob to
a length of max. 1000 everything works fine as well..
Solution: By renaming the fields in the hibernate model so that the clob column has a name
that comes later than the varchar2 column when ordering alphabetically (I prefixed the
clob field in the java class with a 'z'), everything works fine because then the
clob parameter comes after the varchar parameter in the query hibernate builds.. See
http://ora-24816.ora-code.com/
So to summarize:
ok: insert into table (clobfield, varcharfield, id) values (clob4000, null,
123)
ok: insert into table (clobfield, varcharfield, id) values (null, string4000,
123)
ok: insert into table (clobfield, varcharfield, id) values (clob1000, string4000,
123)
not ok: insert into table (clobfield, varcharfield, id) values (clob4000,
stringof4000, 123)
ok: insert into table (varcharfield, clobfield, id) values (stringof4000, clob4000,
123) << create this situation by prefixing the field which represents the clob with
a 'z')
Oracle ORA-24816 inserting and updating data for entities containg
LOB attributes
---------------------------------------------------------------------------------
Key: HHH-4635
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4635
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Reporter: Clay Atkins
Assignee: Strong Liu
Priority: Critical
Inserting or updating an entity with LOB results in the following error from oracle:
{noformat}
Caused by: java.sql.SQLException: ORA-24816: Expanded non LONG bind data supplied after
actual LONG or LOB column
{noformat}
Fairly confident that the ordering of the LOB attributes is not putting them at the end
of the insert or the update. Oracle requires all LOB columns to be the last in the
statement.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira