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.
|