-->
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: NHibernate Proxies losing Exception StackTrace
PostPosted: Thu Jan 24, 2008 5:32 pm 
Senior
Senior

Joined: Thu Jun 21, 2007 8:03 am
Posts: 127
Location: UK
Hi,

The current NHibernate proxy interceptor (correctly) re-throws any errors to maintain the original exception type. Unfortunately, this is causing the exception stack trace to be lost. (mentioned in the code comments in the CastleLazyInitializer.cs)

current trunk code:
Code:
    // Propagate the inner exception so that the proxy throws the same exception as
    // the real object would (though of course the stack trace will be probably lost).
    throw tie.InnerException;


I found a blog that mentioned a way of re-throwing the original error, while also keeping the original stack-trace: http://dotnetjunkies.com/WebLog/chris.taylor/archive/2004/03/03/8353.aspx

I've also put together a potential patch that uses this code: http://freespace.virgin.net/richard.brown0308/NHibernateExceptionStack.patch

Could someone take a look and see if they think this is worth fixing in NHibernate?

Thanks,
Richard


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 26, 2008 1:12 am 
Regular
Regular

Joined: Tue Dec 25, 2007 3:41 pm
Posts: 57
Location: Argentina
Could you send the mail to the dev-list ?

Thanks.

_________________
Dario Quintana


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.