-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: ArrayIndexOutOfBoundsException on session.flush();
PostPosted: Fri Mar 25, 2005 4:33 pm 
Beginner
Beginner

Joined: Mon Feb 23, 2004 5:11 pm
Posts: 39
I am trying to migrate from H2 to H3. I made all changes as instructed in the migration guide. For now, I am using the Hibernate Calssic Session API.

Consider the following the 3 Classes A,B,C and their relationships.

Class A has a bag of Class B
Class A has a bag of Class C
Class B has a bag of Class C

All relationships are biderectional with cascade = all on the one - many side and cascade=none on the many - one side.

Code:
A a = new A();
B b = new B();
C c = new C();

//Now, add b to a's List of b's
b.setA(a);
a.bList.add(b);

//then add c to b's List of c's
c.setB(b);
b.cList.add(c);

//finally set a in c. Minor point: c is not added to a's list of c's
c.setA(a);

//Save a
session.save(a);
session.flush();


I get the following exception:


java.lang.ArrayIndexOutOfBoundsException: 11
at org.hibernate.event.def.DirtyCollectionSearchVisitor.includeProperty(DirtyCollectionSearchVisitor.java:63)
at org.hibernate.event.def.AbstractVisitor.processValues(AbstractVisitor.java:42)
at org.hibernate.event.def.AbstractVisitor.processComponent(AbstractVisitor.java:62)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:87)
at org.hibernate.event.def.AbstractVisitor.processValues(AbstractVisitor.java:43)
at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:300)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:111)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:190)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:70)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:669)


This used to work fine in H2. Any info would be appreciated. Thank You.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 29, 2005 11:10 am 
Beginner
Beginner

Joined: Mon Feb 23, 2004 5:11 pm
Posts: 39
I am still stuck with this issue. Is any body looking into this? Any info would be greatly appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 29, 2005 5:28 pm 
Beginner
Beginner

Joined: Thu Feb 17, 2005 4:20 pm
Posts: 29
Could be the same issue I posted a while back that Gavin has fixed. I don't think he fix is in RC1. Go get the latest from cvs..

http://forum.hibernate.org/viewtopic.php?t=939351


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 29, 2005 6:27 pm 
Beginner
Beginner

Joined: Mon Feb 23, 2004 5:11 pm
Posts: 39
Thanks a lot. I will give it a try.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.