-->
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: AbstractLockUpgradeEventListener.UpgradeLock null ref except
PostPosted: Mon Feb 25, 2008 11:13 pm 
Beginner
Beginner

Joined: Mon Aug 15, 2005 11:50 pm
Posts: 22
Can anyone provide insight into what scenarios may cause the UpgradeLock to have a null Exception.

In code I had a cached entity with child collection, the code executes:
Code:
UnitOfWork.CurrentSession.Lock(project,LockMode.None)


Changing code to use CurrentSession.Update(project) is my workaround for the time being.

and crashing with the following: (Not sure of the svn rev number of NH (2.x), I am using the version in rhino commons as of a few days ago)

Code:
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at NHibernate.Event.Default.AbstractLockUpgradeEventListener.UpgradeLock(Object entity, EntityEntry entry, LockMode requestedLockMode, ISessionImplementor source) in d:\OSS\nhibernate\src\NHibernate\Event\Default\AbstractLockUpgradeEventListener.cs:line 29
   at NHibernate.Event.Default.DefaultLockEventListener.OnLock(LockEvent event) in d:\OSS\nhibernate\src\NHibernate\Event\Default\DefaultLockEventListener.cs:line 55
   at NHibernate.Impl.SessionImpl.FireLock(LockEvent lockEvent) in d:\OSS\nhibernate\src\NHibernate\Impl\SessionImpl.cs:line 1914
   at NHibernate.Impl.SessionImpl.Lock(Object obj, LockMode lockMode) in d:\OSS\nhibernate\src\NHibernate\Impl\SessionImpl.cs:line 525
   at NHibernate.Engine.Cascades.CascadingAction.ActionLockClass.Cascade(IEventSource eventSource, Object child, Object anything) in d:\OSS\nhibernate\src\NHibernate\Engine\Cascades.cs:line 131
   at NHibernate.Engine.Cascades.Cascade(IEventSource eventSource, Object child, IType type, CascadingAction action, CascadeStyle style, CascadePoint cascadeTo, Object anything) in d:\OSS\nhibernate\src\NHibernate\Engine\Cascades.cs:line 477
   at NHibernate.Engine.Cascades.CascadeCollection(CascadingAction action, CascadeStyle style, CollectionType collectionType, IType elemType, Object child, CascadePoint cascadeVia, IEventSource eventSource, Object anything) in d:\OSS\nhibernate\src\NHibernate\Engine\Cascades.cs:line 597
   at NHibernate.Engine.Cascades.Cascade(IEventSource eventSource, Object child, IType type, CascadingAction action, CascadeStyle style, CascadePoint cascadeTo, Object anything) in d:\OSS\nhibernate\src\NHibernate\Engine\Cascades.cs:line 497
   at NHibernate.Engine.Cascades.Cascade(IEventSource eventSource, IEntityPersister persister, Object parent, CascadingAction action, CascadePoint cascadeTo, Object anything) in d:\OSS\nhibernate\src\NHibernate\Engine\Cascades.cs:line 558
   at NHibernate.Engine.Cascades.Cascade(IEventSource eventSource, IEntityPersister persister, Object parent, CascadingAction action, CascadePoint cascadeTo) in d:\OSS\nhibernate\src\NHibernate\Engine\Cascades.cs:line 530
   at NHibernate.Event.Default.DefaultLockEventListener.CascadeOnLock(LockEvent event, IEntityPersister persister, Object entity) in d:\OSS\nhibernate\src\NHibernate\Event\Default\DefaultLockEventListener.cs:line 64
   at NHibernate.Event.Default.DefaultLockEventListener.OnLock(LockEvent event) in d:\OSS\nhibernate\src\NHibernate\Event\Default\DefaultLockEventListener.cs:line 52
   at NHibernate.Impl.SessionImpl.FireLock(LockEvent lockEvent) in d:\OSS\nhibernate\src\NHibernate\Impl\SessionImpl.cs:line 1914
   at NHibernate.Impl.SessionImpl.Lock(Object obj, LockMode lockMode) in d:\OSS\nhibernate\src\NHibernate\Impl\SessionImpl.cs:line 525
   at Qfrs.ProjectRegister.Application.CostPresenter.CheckAndBindProject() in D:\Inetpub\ORPUDev\src\Qfrs.ProjectRegister.Application\CostPresenter.cs:line 63



I don't currently have a test around this but I'll try and get one to reproduce if possible.

Regards,
Jason


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 18, 2008 6:41 pm 
Newbie

Joined: Thu Dec 21, 2006 4:34 am
Posts: 13
I have a failing unit test (well integration) test that reproduces this problem. I've been meaning to submit this as a bug report but just haven't got around to it yet.

I'm going to try and submit this week.

Christian


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.