Hi Jody,

Thanks for the reply.
Attached is the schema dump for the table. The schema generator tool does
map 
the sla_xml column to varchar2(4000). So it seems to honor the @length
annotation.
The code where we define the JPA annotations for this table are at
https://svn.apache.org/repos/asf/oozie/trunk/core/src/main/java/org/apache/
oozie/WorkflowActionBean.java
and 
https://svn.apache.org/repos/asf/oozie/trunk/core/src/main/java/org/apache/
oozie/client/rest/JsonWorkflowAction.java

Thanks,
Virag

On 6/28/13 10:29 AM, "Jody Grassel" <fyrew...@gmail.com> wrote:

>Hey there.  The @Length annotation should only be used by OpenJPA as an
>instruction to the schema generator tool, the runtime relies on the
>database to enforce the maximum length of a given column - which may or
>may
>not throw an Exception given the configured behavior of the database.
>
>Would you be willing to provide a unit test and a schema dump of your
>table
>from the database?
>
>On Friday, June 28, 2013, Virag Kothari wrote:
>
>> Hi,
>>
>> Can anyone please reply?
>>
>> In summary, two questions
>>
>> Having (@length=4000) is not working when using Oracle db. I see the
>> schema maps to varchar2(4000) but the openjpa insert accepts max 1000
>>chars
>> (throws ORA-24816 which is strange). It is not an Oracle issue as I
>>tried
>> inserting in Oracle directly and anything less than 4000 chars works.
>>Can
>> someone explain why openjpa allows only 1000 chars even if the length is
>> set higher?
>>
>> Is it possible to arrange the columns in a particular order (order
>>defined
>> in java file or based on some other order) so all lob's can be at the
>>end?
>> We require this if we face ORA-24816
>>
>> Thanks,
>>
>> Virag
>>
>>
>>
>>
>> From: Virag Kothari <vi...@yahoo-inc.com <javascript:;><mailto:
>> vi...@yahoo-inc.com <javascript:;>>>
>> Date: Monday, June 24, 2013 1:35 PM
>> To: "users@openjpa.apache.org <javascript:;><mailto:
>> users@openjpa.apache.org <javascript:;>>"
>><users@openjpa.apache.org<javascript:;>
>> <mailto:users@openjpa.apache.org <javascript:;>>>
>> Subject: Re: ORA-24816 - column ordering during inserts
>>
>> Hi,
>>
>> An update:
>>
>> It seems the problem is something else.
>> In our code, we have defined the length as 4000.
>>
>>     @Basic
>>
>>     @Column(name = "sla_xml", length = 4000)
>>
>>     private String slaXml = null;
>>
>> However, if this column has more than 1000 characters, it complains with
>> the below ORA-24816.
>>
>> With less than 1000 characters, it works.
>>
>> Also, I see in the oracle schema that the column is mapped as varchar2.
>>
>> So even though the length is defined as 4000, why does openjpa refuse to
>> accept more than 1000 characters?
>>
>> Can anyone help me to figure this out?
>>
>>
>> Thanks,
>>
>> Virag
>>
>>
>>
>>
>> From: Virag Kothari <vi...@yahoo-inc.com <javascript:;><mailto:
>> vi...@yahoo-inc.com <javascript:;>>>
>> Date: Friday, June 21, 2013 8:01 PM
>> To: "users@openjpa.apache.org <javascript:;><mailto:
>> users@openjpa.apache.org <javascript:;>>"
>><users@openjpa.apache.org<javascript:;>
>> <mailto:users@openjpa.apache.org <javascript:;>>>
>> Subject: ORA-24816 - column ordering during inserts
>>
>> Hi,
>>
>> We are using Open JPA 2.2.2 in Oozie project.
>>
>> We have a mixture of lob and varchar in our tables. We
>> recently converted few of lob's to varchar (4000).
>> Now sometimes, we are seeing the following error while inserting in
>>table:
>>
>> Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ORA-24816:
>> Expanded non LONG bind data supplied after actual LONG or LOB column
>>
>> It seems that ORA-24816 happens when lob's are not at the end of the
>> insert/update list.
>>
>> 2 questions:
>>
>>   1.
>>
>> Is it possible to arrange the columns in a particular order (order
>>defined
>> in java file or based on some other order) so we can have all lob's at
>>the
>> end?
>>
>>    2. We never encountered this error before even though we had 6 lobs
>>and
>> almost dozen of varchars in our table.  We converted 3 lobs to
>> varchar2(4000) and started seeing this issue intermittently. Does anyone
>> suspect that this conversion from lob to varchar has a role to play?
>>
>> Thanks,
>>
>> Virag
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>

Insert into EXPORT_TABLE ("DBMS_METADATA.GET_DDL('TABLE',U.TABLE_NAME)") values 
('
  CREATE TABLE "HCATUSR21"."WF_ACTIONS" 
   (    "ID" VARCHAR2(255) NOT NULL ENABLE, 
        "CONF" CLOB, 
        "CONSOLE_URL" VARCHAR2(255), 
        "CRED" VARCHAR2(255), 
        "ERROR_CODE" VARCHAR2(255), 
        "EXTERNAL_CHILD_IDS" CLOB, 
        "EXTERNAL_ID" VARCHAR2(255), 
        "EXTERNAL_STATUS" VARCHAR2(255), 
        "NAME" VARCHAR2(255), 
        "RETRIES" NUMBER, 
        "STATS" CLOB, 
        "TRACKER_URI" VARCHAR2(255), 
        "TRANSITION" VARCHAR2(255), 
        "TYPE" VARCHAR2(255), 
        "USER_RETRY_COUNT" NUMBER, 
        "USER_RETRY_INTERVAL" NUMBER, 
        "USER_RETRY_MAX" NUMBER, 
        "BEAN_TYPE" VARCHAR2(31), 
        "END_TIME" TIMESTAMP (6), 
        "EXECUTION_PATH" VARCHAR2(1024), 
        "LAST_CHECK_TIME" TIMESTAMP (6), 
        "LOG_TOKEN" VARCHAR2(255), 
        "PENDING" NUMBER, 
        "PENDING_AGE" TIMESTAMP (6), 
        "SIGNAL_VALUE" VARCHAR2(255), 
        "START_TIME" TIMESTAMP (6), 
        "STATUS" VARCHAR2(255), 
        "WF_ID" VARCHAR2(255), 
        "SLA_XML" VARCHAR2(4000), 
        "ERROR_MESSAGE" VARCHAR2(4000), 
        "DATA" VARCHAR2(4000), 
         PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "HCAT20TO30"  ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "HCAT20TO30" 
 LOB ("CONF") STORE AS BASICFILE (
  TABLESPACE "HCAT20TO30" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("EXTERNAL_CHILD_IDS") STORE AS BASICFILE (
  TABLESPACE "HCAT20TO30" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("STATS") STORE AS BASICFILE (
  TABLESPACE "HCAT20TO30" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ');

Reply via email to