Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » EclipseLink JPA Multi-Tenancy - Bidirectional OneToOne - ArrayIndexOutOfBoundsException(ArrayIndexOutOfBoundsException thrown in JPA Bidirectional One To One relation)
icon4.gif  EclipseLink JPA Multi-Tenancy - Bidirectional OneToOne - ArrayIndexOutOfBoundsException [message #797243] Mon, 13 February 2012 08:18 Go to next message
Mohammad Abdo is currently offline Mohammad AbdoFriend
Messages: 6
Registered: January 2012
Location: Jordan
Junior Member
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

Re: EclipseLink JPA Multi-Tenancy - Bidirectional OneToOne - ArrayIndexOutOfBoundsException [message #797495 is a reply to message #797243] Mon, 13 February 2012 15:09 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
Hello,

Please use the above description and stack to file a bug and vote for it.
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EclipseLink

A workaround might be to mark the relationships as lazy, since the error occurs in the code used to get the referenced object.

Best Regards,
Chris
Previous Topic:Relative Path to JDBC-Url
Next Topic:Optimistic lock - Delete
Goto Forum:
  


Current Time: Thu Apr 25 16:49:50 GMT 2024

Powered by FUDForum. Page generated in 0.03072 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top