Hello,

I have a property of type TimeSpan? (nullable) and an
ICompositeUserType that uses two database columns. (if the property is
null, both database fields are null, otherwise one contains number of
days represented by the timespan, and the other one an integer)

Everything is working fine, both saving and reading works fine.

Except that if this property is set to null, the following happens:

1) An insert to the database first calls NullSafeSet and properly
inserts the correct values into the database based on my custom logic.
Afterwards, on transaction.Commit() or session.Flush() it again calls
NullSafeSet on my ICompositeUserType and results in an update of the
same database row, again setting the two database fields to null.
(even if they were already null)

2) If by reading from the database, eventually going through
NullSafeGet, the property is read back as null, closing the session
again updates the two fields with nulls (although they were already
null).

Note that this does not happen for values other than null. Those are
not being detected as dirty.

So what exactly is causing NHibernate to think that field is dirty?
How does dirty checking work in this case? I'm not sure how to debug
this further or if this is a bug in NHibernate.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to