Graham,

You are both right, SQL (pre 2008) has an issue that a datetime is
only accurate up to 3.33 milliseconds
Override your dialect as follows and you should be seeing more correct
behavior, the value stored in your memory object needs to be rounded
to the milisecond
so don't forget to refresh the object or let your mapping handle it by
adding generated=true

    public class MySQL2005Dialect: NHibernate.Dialect.MsSql2005Dialect
    {
        public override long TimestampResolutionInTicks
        {
            get
            {
                return 33 300L; // 1 =100 nanaseconds and 3.33
milliseconds is 3 330 000 nanoseconds :)
            }
        }
    }

Kind regards

On 22 jul, 11:10, Graham Bunce <[email protected]> wrote:
> Ok... but it's not SQL Server that has the problem. The problem is
> that NH is being given a time of "2009-10-09 12:43:11.222" but is
> sending to SQL Server (according to the insert statement in SQL
> Profiler) a time of "2009-10-09 12:43:11.223"... i.e. not the time it
> was given.
--~--~---------~--~----~------------~-------~--~----~
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