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 giving useless exception messages
PostPosted: Sat Nov 21, 2009 6:58 pm 
Newbie

Joined: Sat Nov 21, 2009 4:52 pm
Posts: 1
It seems that whenever NHibernate gives an Exception, I get the error message
"null id in <ClassName> entry (don't flush the Session after an exception occurs)". As far as I can tell, this will occur for any failed sql insert statement whether an identity column isn't set, a column name is incorrect, string or binary data would be truncated, inserting null into a non-null column, or any other SQL Server level exception.

The exception has no inner exception and a useless error message. Is there any way to get the actual error message for the exception (the original "String or Binary data would be truncated")?

I'm using NHibernate 2.1.1 GA.


Top
 Profile  
 
 Post subject: Re: NHibernate giving useless exception messages
PostPosted: Mon Nov 23, 2009 8:58 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
Is that the first exception you are getting ? As soon as you get an exception in a session, the session becomes useless. You have to dispose the session and create a new one. If you try to flush a session after an exception you will get the exception you got.

_________________
--Wolfgang


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.