Issue is very similar to https://hibernate.atlassian.net/browse/HHH-4635. The difference is that they have a MappedSuperclass (containing the @Lob) This results in the Lob column appearing somewhere in the middle of the columns in the insert clause, however the Clob parameter is last in the bindings.
Hibernate Issue: https://hibernate.atlassian.net/browse/HHH-8705
Created attachment 825911 [details] Entities to reproduce Create and persist a SubEntity should reproduce the issue.
Dave, still not able to reproduce on oracle11gR2 and ORM 4.2.0.SP1 (EAP 6.1.1) -- can you post your insertion code? Not sure what else is missing.
Hi Brett, My insertion code is simply: SubEntity b = new SubEntity("TestClob", new BigInteger("1")); b.setCode("code"); em.persist(b); Which results in this insert statement and parameters, and the following exception: 09:32:17,433 DEBUG [org.hibernate.SQL] (http-localhost/127.0.0.1:8080-2) insert into SubEntity (SUBENTITYID, MYCLOB, UFLAGS, CODE, FLAGS, VERSION) values (MMSSEQ.nextval, ?, ?, ?, ?, ?) 09:32:26,757 TRACE [org.hibernate.type.descriptor.sql.BasicBinder] (http-localhost/127.0.0.1:8080-2) binding parameter [1] as [NUMERIC] - 1 09:32:26,758 TRACE [org.hibernate.type.descriptor.sql.BasicBinder] (http-localhost/127.0.0.1:8080-2) binding parameter [2] as [VARCHAR] - code 09:32:26,758 TRACE [org.hibernate.type.descriptor.sql.BasicBinder] (http-localhost/127.0.0.1:8080-2) binding parameter [3] as [NUMERIC] - <null> 09:32:26,759 TRACE [org.hibernate.type.descriptor.sql.BasicBinder] (http-localhost/127.0.0.1:8080-2) binding parameter [4] as [BIGINT] - 0 09:32:26,759 TRACE [org.hibernate.type.descriptor.sql.BasicBinder] (http-localhost/127.0.0.1:8080-2) binding parameter [5] as [CLOB] - TestClob 09:34:22,168 DEBUG [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-localhost/127.0.0.1:8080-2) could not execute statement [n/a]: java.sql.SQLSyntaxErrorException: ORA-01722: invalid number
The real issue ended up as a duplicate of https://hibernate.atlassian.net/browse/HHH-8103 which was fixed in ORM 4.2.1 and therefore already in EAP 6.2.0. Closing.