views:

254

answers:

1

I am trying to persist an Entity with a @Lob annotated String field. The content of that fiels if bigger than the 40k buffer size limit.

The first problem I had was related to the setString method used internally by the JPA implementation (Hibernate in my case) and the Oracle JDBC Driver. This problem was solved adding

<property name="hibernate.connection.SetBigStringTryClob" value="true"/>

to my persistence.xml file.

Then, the error changed to a ORA-22835 error (the buffer is too small). ¿Is there any way that JPA solves this problem without going to a low-level implementation? ¿Any suggestions?

A: 

Can your try with Oracle 10g Release 2 drivers (pick up the most recent ojdbc14.jar i.e. 10.2.0.4) or later (older versions are buggy as mentioned in this previous answer).

Pascal Thivent
OK then... I downloaded the last drivers (which I thought I already had, but I was wrong).Now I have another error: ORA-24816 =>Expanded non LONG bind data supplied after actual LONG or LOB columnI have read that this is an Oracle issue. Is there any way to make JPA (or the underlying implementation, Hibernate in my case) sort the columns in a given order so the Clob column comes last? It looks like that's the problem I am having now...
Kenneth
The problem just vanished :S I'm not very happy about it because what vanishes today can reappear tomorrow, but it sure looks like configuration issue.
Kenneth