-->
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: NullPointerException in SessionImpl (getOrphans)
PostPosted: Fri Jan 23, 2004 5:01 pm 
Newbie

Joined: Fri Sep 12, 2003 9:13 am
Posts: 10
Gettings,

I'm having a strange error. I'm trying to update an object that is in my servlet session, both to ensure it is up to date and to associate it with my current session, but I get an error on the update. The exception is from within SessionImpl, and is follows:

Code:
        at net.sf.hibernate.engine.Cascades.deleteOrphans(Cascades.java:542)
        at net.sf.hibernate.engine.Cascades.cascadeCollection(Cascades.java:533)
        at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:452)
        at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:503)
        at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:482)
        at net.sf.hibernate.impl.SessionImpl.doUpdate(SessionImpl.java:1408)
        at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1327)
        at net.sf.hibernate.engine.Cascades$4.cascade(Cascades.java:114)
        at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:436)
        at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:503)
        at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:482)
        at net.sf.hibernate.impl.SessionImpl.doUpdate(SessionImpl.java:1408)
        at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1327)
        at com.ts.users.daoimpl.HibernateUserDAO.updateUser(HibernateUserDAO.java:200)
        at com.ts.users.UserFunctions.updateUser(UserFunctions.java:324)


Starting at the bottom, I call updateUser on my User object (from the Session), it in turn hits the DAO which does an update on it. It rapidly falls apart after that.

Any idea whats happening here? The User object references other persistent objects and collections.. many of which are empty at this time. Is this a mapping error of some sort, or some other problem?

thanks for assistance.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2004 1:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Ummmm. Exception message??


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2004 1:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
oh ok, it is an npe


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2004 1:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I suspect that the problem is that you have assigned a new collection to the property. You many not do this with a collection that has orphan delete enabled. You MUST pass back the same collection instance that was originally assigned to the object.

However, I'm annoyed that this causes an actual NPE. Are you sure you are using the most recent release of Hibernate? If so, would you please submit a very simple main() method to JIRA to reproduce this. TIA


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.