You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Jeremy Bauer (JIRA)" <ji...@apache.org> on 2011/05/23 18:59:47 UTC

[jira] [Commented] (OPENJPA-1691) Oracle XMLType column failed to insert/update when xml contains more than 4000 characters

    [ https://issues.apache.org/jira/browse/OPENJPA-1691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038045#comment-13038045 ] 

Jeremy Bauer commented on OPENJPA-1691:
---------------------------------------

The fix for this issue in 2.1.0 involved full JDBC 4.0-level support within OpenJPA.  This is not possible on releases prior to 2.1.0 since they support Java 1.5. Thus, the same fix for this issue is not possible on pre-2.1.x releases.  Using reflection, I was able to produce a patch that works with prior releases and still compiles and works with Java 1.5.  The code reflectively calls JDBC 4.0 methods to set the XML value as a clob input reader.  JRE 1.6 and an Oracle 1.6 (ojdbc6.jar) are required.  In addition, the OracleDictionary supportsSetClob value must be set to true in order to enable the support.  If DBCP is used, at least DBCP 1.4 is required since it supports call-thru of JDBC 4.0 connection and prepared statement methods.

> Oracle XMLType column failed to insert/update when xml contains more than 4000 characters
> -----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1691
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1691
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.2.2, 2.0.0, 2.0.1
>         Environment: Oracle 10g, JDBC driver (ojdbc14.jar) 10.2.0.4.0, OpenJPA 1.2.2
>            Reporter: Kelvin Law
>            Assignee: Milosz Tylenda
>              Labels: openjpa, oracle, xmltype
>             Fix For: 2.1.0
>
>
> Oracle throws the following exception when XML content is greater than 4000 characters:
> ORA-01461: can bind a LONG value only for insert into a LONG column

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira