-->
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: NPC from Session.delete(Object) after upgrading to 2.1.1
PostPosted: Wed Jan 14, 2004 11:52 am 
Newbie

Joined: Wed Oct 15, 2003 11:20 am
Posts: 6
Hello,

After upgrading my application from 2.0 to 2.1.1, I'm getting a NullPointerException with some Session.delete(obj). The code supposedly ran fine before, therefore I started tracing 2.1.1 source code. After persevering for a long long time... I find that the NullPointerException originated in PersistentCollection :

static void identityRemove(Collection list, Object object, SessionImplementor session)
throws HibernateException {

if ( object!=null && session.isSaved(object) ) {

Serializable idOfCurrent = session.getEntityIdentifierIfNotUnsaved(object);
Iterator iter = list.iterator();
while ( iter.hasNext() ) {
Serializable idOfOld = session.getEntityIdentifierIfNotUnsaved( iter.next() );
if ( idOfCurrent.equals(idOfOld) ) {
iter.remove();
break;
}
}

}
}



in my case, idOfCurrent is null, and the code doesn't seem expect the case

Can anyone shed some light on this problem? Or has any similar problem been reported? Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 14, 2004 11:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Are you setting the id up front to null? This sounds very strange, please show your code.


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.