-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Medium
-
None
-
Affects Version/s: 7.6.11
-
Component/s: Import / Export [Deprecated]
-
7.06
-
6
-
Severity 3 - Minor
-
8
Summary
Active Objects library, which presents the abtraction for data types and object relational mapping, does not work consistently across supported platforms, hence migration fails.
When migrating from another database (I.e. mySQL) to Oracle database, using an XML export generated from source system, following exception appears in the logs;
ORA-12899: value too large for column "JIRA3L"."AO_544E33_AUDIT_LOG_ENTRY"."ISSUE_SUMMARY" (actual: 263, maximum: 255)
This happens with an third-party app that has defined a string column with length 255. In the MySQL database it was possible to store 255 characters, no matter which kind of characters was used. E.g. it is possible to store 255 Chinese characters. In Oracle the column is created as VARCHAR2(255 BYTE). But in order to store 255 special characters, the suitable data type in Oracle would be VARCHAR2(255 CHAR). So the reason for the exception is, that 255 special characters need more than 255 bytes, but the column definition in Oracle is limited to 255 byte.
Steps to Reproduce
A test to recreate the problem is provided at JRASERVER-62833. Quoting;
// class import net.java.ao.*; import net.java.ao.schema.StringLength; import net.java.ao.schema.Table; @Table("T_TEST_CLASS") public interface TestClassAO extends Entity { String TEST_FIELD_ID = "C_TEST_FIELD"; @Accessor(TEST_FIELD_ID) @StringLength(6) String getTestField(); } // run test myActiveObjects.create(TestClassAO.class, new DBParam(TestClassAO.TEST_FIELD_ID, "привет"));
Expected Results
Migration is successful, and all AO data are transferred to new database successfully.
Actual Results
Migration fails with ORA-12899 error.
Workaround
None