-->
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: Strange error only happens when using nullables (1.0.1)
PostPosted: Thu Jan 19, 2006 2:51 pm 
Beginner
Beginner

Joined: Fri Nov 11, 2005 1:04 pm
Posts: 22
I'm using the Nullable DateTime in my business objects (exposed as a standard DateTime object on the property because VB doesn't understand operator overloading using access set to member). When the property is accessed "null" gets converted to DateTime.minValue and vice versa.

For some strange reason an exception is thrown when I use the NullableDateTime (as opposed to passing a constant DateTime value and using that to represent null in my DB because DateTime.minValue causes an ADO exception because it's out of range on SQL Server...go figure).

Basically, NHibernate balks when saving a new object to the DB complaining that it can't Convert DBNull to Int32...it looks like it's trying to set the identifier but can't.

I will post the mapping/code/and log later but has anyone actually seen something similar?

Like I said, I dont have this problem unless I'm using the Nullables.


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.