Dear All,
I am doing POC for migrating our applications from EclipseLink Native ORM to EclipseLink JPA supporting Multi-Tenancy.
The environment details as follows:
- OC4J Extended: Standalone OC4J Server.
- JDeveloper 10g (10.1.3.5)
- EclipseLink 2.3.2, with multi-tenancy.
- I am using JPA 2.0 features and I need to use the new features of EclipseLink
2.3.2. (Multi-Tenancy)
- I already configured EclipseLink as JPA 2.0 Persistence Provider for the
OC4J_Extended as mentioned in the Wiki OC4J_Web_Tutorial.
I have a One To One relation between Student and Project entities as follows:
The Student entity:
public class StudentEntity {
...
@OneToOne(optional=false, cascade={CascadeType.ALL})
@JoinColumn(name="PROJECT_ID", unique=true, nullable=false,
updatable=false, referencedColumnName="ID")
private ProjectEntity project;
....
}
The Project Entity:
public class ProjectEntity extends TABSEntity {
...
@OneToOne(mappedBy="project", cascade={CascadeType.ALL})
private StudentEntity student;
...
}
The following the database tables structure:
CREATE TABLE t_o2o_b_student (
id NUMBER(10, 0) PRIMARY KEY,
name VARCHAR2(120) NOT NULL,
nationality VARCHAR2(120) ,
join_date DATE NOT NULL,
project_id NUMBER(10, 0) NULL UNIQUE,
created_by VARCHAR2(40) NOT NULL,
created_date TIMESTAMP(6) NOT NULL,
modified_by VARCHAR2(40) NOT NULL,
modified_date TIMESTAMP(6) NOT NULL,
tenant_id VARCHAR2(20) NULL
);
CREATE TABLE t_o2o_b_project (
id NUMBER(10, 0) PRIMARY KEY,
title VARCHAR2(120) NOT NULL,
description VARCHAR2(120) ,
created_by VARCHAR2(40) NOT NULL,
created_date TIMESTAMP(6) NOT NULL,
modified_by VARCHAR2(40) NOT NULL,
modified_date TIMESTAMP(6) NOT NULL,
tenant_id VARCHAR2(20) NULL
);
The persist operation works fine.
But find, merge and remove operations throws:
java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 8
at org.eclipse.persistence.internal.helper.NonSynchronizedVector.set(NonSynchronizedVector.java:273)
at org.eclipse.persistence.internal.sessions.AbstractRecord.put(AbstractRecord.java:610)
Full exception stack attached...
Noticing that; whenever I disable the multi-tenancy it all persist, merge, find and delete works fine...
[Updated on: Mon, 13 February 2012 12:53]
Report message to a moderator