I have a (hibernate generated) DB schema for an Oracle 11g XE database with a table having a CLOB column and VARCHAR (2000) column and its associated audit table:
Since HHH-4635, it is taken care that LOB columns will be last in insert and update statements because Oracle does not support if there is a variable binding parameter for a VARCHAR exceeding a certain size passed after the binding parameter for the CLOB column.
Accordingly, the generated insert statement for my_entity has details passed as last parameters: insert into my_entity (title, id, details) values (?, ?, ?)
However, for the envers statement, the VARCHAR column title comes after the CLOB column details: insert into my_entity_aud (revtype, details, title, id, rev) values (?, ?, ?, ?, ?)
ORA-24816: Expanded non LONG bind data supplied after actual LONG or LOB column
I have a github repository where the error can be reproduced:https://github.com/h2m/hibernate-envers-HHH-12186