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.  [ 1 post ] 
Author Message
 Post subject: NullRefExc on Transaction.Commit
PostPosted: Thu Jul 19, 2007 2:32 pm 
Newbie

Joined: Fri Dec 01, 2006 6:41 pm
Posts: 1
Hi, all. We get this exception on commit when saving an entity (Entity A). We've verified the session/transaction are still open so it's not a LazyInit that you get when the session is no longer available.

This is on 1.2GA w/ SQL2000. Every entity has a proxy defined (same class w/ virtuals pattern). Entity A has a many-to-one to B (cascade=none). B has parent-child relationship to self (think tree). i.e. B has many-to-one to B ("Parent", cascade=none) and has one-to-many to B ("Children", cascade=save-update, inverse=true, lazy=true).

We've been debugging through it and it looks like the null ref exception is occuring because CollectionEntry.LoadedPersister is null. I cannot figure out what I'm doing wrong to cause it though. Thanks in advance for any help.

Cheers,
~Mork

Here's a partial stack trace:

NHibernate.LazyInitializationException: Failed to lazily initialize a collection ----> System.NullReferenceException: Object reference not set to an instance of an object.
at NHibernate.Impl.SessionImpl.GetCollectionOwner(Object key, ICollectionPersister collectionPersister) in C:\Downloads\NHibernate\src\NHibernate\Impl\SessionImpl.cs:line 4508
at NHibernate.Impl.SessionImpl.GetCollectionOwner(CollectionEntry ce) in C:\Downloads\NHibernate\src\NHibernate\Impl\SessionImpl.cs:line 4502
at NHibernate.Impl.SessionImpl.InitializeCollection(IPersistentCollection collection, Boolean writing) in C:\Downloads\NHibernate\src\NHibernate\Impl\SessionImpl.cs:line 4484
at NHibernate.Collection.AbstractPersistentCollection.Initialize(Boolean writing) in C:\Downloads\NHibernate\src\NHibernate\Collection\AbstractPersistentCo...).


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

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.