-->
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.  [ 2 posts ] 
Author Message
 Post subject: NullPointerException in ActionQueue.resumeSuspendedDeletions
PostPosted: Fri Mar 11, 2005 5:09 am 
Beginner
Beginner

Joined: Tue Apr 20, 2004 12:07 pm
Posts: 21
A fairly basic deletion of a persistent object results in a NullPointerException in ActionQueue.resumeSuspendedDeletions. The same code did not produce the exception in Hibernate beta 4.

I will look into the source code of Hibernate later on when time permits and add a more detailed description of scenario that led to this error. The error was produced running Junit tests after migrating from beta4 to rc1.
I wan't to know if anybody else has the same problem.


Hibernate version: 3.0r1

<list name="children"
lazy="true"
inverse="false"
access="field"
cascade="all">

<key column="parent_id"/>
<index column="parent_idx"/>
<one-to-many class="nl.tresparc.model.TDItem" />
</list>

Basic Java code which removes a child element from the collection
--
children.remove(item);
item.parent = null;
currentSession().delete(item);
--

Results in the following exception:

java.lang.NullPointerException
at java.util.ArrayList.addAll(ArrayList.java:474)
at org.hibernate.engine.ActionQueue.resumeSuspendedDeletions(ActionQueue.java:337)
at org.hibernate.event.def.DefaultDeleteEventListener.deleteEntity(DefaultDeleteEventListener.java:223)
at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:108)
at org.hibernate.impl.SessionImpl.delete(SessionImpl.java:535)
at org.hibernate.engine.Cascades$1.cascade(Cascades.java:67)
at org.hibernate.engine.Cascades.cascade(Cascades.java:721)
at org.hibernate.engine.Cascades.cascadeCollection(Cascades.java:860)
at org.hibernate.engine.Cascades.cascade(Cascades.java:739)
at org.hibernate.engine.Cascades.cascade(Cascades.java:817)
at org.hibernate.engine.Cascades.cascade(Cascades.java:789)
at org.hibernate.event.def.DefaultDeleteEventListener.cascadeBeforeDelete(DefaultDeleteEventListener.java:246)
at org.hibernate.event.def.DefaultDeleteEventListener.deleteEntity(DefaultDeleteEventListener.java:199)
at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:108)
at org.hibernate.impl.SessionImpl.delete(SessionImpl.java:527)
at nl.tresparc.model.TDWasteBasketItem.empty(TDWasteBasketItem.java:72)


Top
 Profile  
 
 Post subject: Latest from CVS
PostPosted: Fri Mar 11, 2005 5:44 am 
Beginner
Beginner

Joined: Tue Apr 20, 2004 12:07 pm
Posts: 21
Retrieved the latest from CVS and it seems that the problem is fixed.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.