That is an issue with date times in the profiler, I'll fix it to generate date times in a culture independent format.
On Tue, Jan 20, 2009 at 6:45 AM, Chris Smith <chris.j.smith.uk@ googlemail.com> wrote: > > My end needs fixing. NHprof is ok. > > I've run the date parser through the debugger and unit tests and > binding to a DateTime has the correct day, month, year value on the > object prior to persistence. DateTime is locale independant. When it > arrives at the DB through nhibernate however, the statement fails > because the month is greater than 12. Odd. > > I'll run it through SQL profiler and post back later with my findings. > > Cheers, > > Chris. > > 2009/1/20 Ayende Rahien <[email protected]>: > > There is _no need_ to create a fix, because there is no problem. > > This is strictly a presentation issue in the UI (and the logs), that is > all > > > > On Tue, Jan 20, 2009 at 6:33 AM, Chris Smith > > <[email protected]> wrote: > >> > >> Ok didn't realise that. I assume it formats the date using the system > >> locale on the client? > >> > >> I'll run it through SQL Profiler and see what is happening there, > >> failing that going back to straight ado to work out a fix. > >> > >> Really banging my head on the wall with this one. > >> > >> Cheers, > >> > >> Chris. > >> > >> 2009/1/20 Ayende Rahien <[email protected]>: > >> > That isn't what is actually going on. > >> > The type is being sent as a date time to the DB, not as a string. > >> > NH Prof just show it to you that way because this is the way that make > >> > sense > >> > to us. > >> > > >> > On Tue, Jan 20, 2009 at 6:15 AM, Chris Smith > >> > <[email protected]> wrote: > >> >> > >> >> No it doesn't. The column is a DateTime and the object is a > DateTime. > >> >> The mapping specifies no type. As it goes over the connection > >> >> (looking at it from NHprof), it's being sent as a string when doing > >> >> the INSERT which is where the confusion is occuring. > >> >> > >> >> Cheers, > >> >> > >> >> Chris. > >> >> > >> >> 2009/1/20 Stefan Steinegger <[email protected]>: > >> >> > > >> >> > I don't understand the problem. Where does NHibernate "generate a > >> >> > date > >> >> > format"? You should have a DateTime in the entity and a date in the > >> >> > database. Dates in queries should be passed as parameters, not as > >> >> > strings. Doesn't this work? > >> >> > > >> >> > On 19 Jan., 16:38, "[email protected]" > >> >> > <[email protected]> wrote: > >> >> >> Is there a way to force hibernate to generate a > non-locale-specific > >> >> >> date format so I can insert dates without worrying about if they > are > >> >> >> interpreted as US/UK english? > >> >> >> > >> >> >> At the moment they are being sent as text i.e. '06/07/2008 > >> >> >> 12:14:00'. > >> >> >> > >> >> >> Unfortunately some muppet set up our DB and web servers with > >> >> >> different > >> >> >> locales so 06/07 is ambiguous (US English SQL Server 2005 server, > UK > >> >> >> English Windows 2008 client). > >> >> >> > >> >> >> Using NH 2.0.1 as bundled by spring.net 1.2.0, mssql2005 dialect > and > >> >> >> sqlserver-2.0 provider. > >> >> >> > >> >> >> Any help appreciated. > >> >> >> > >> >> >> Cheers, > >> >> >> > >> >> >> Chris. > >> >> > > > >> >> > > >> >> > >> >> > >> >> > >> >> -- > >> >> Chris Smith > >> >> http://www.chrisjsmith.me.uk/ > >> >> > >> >> > >> > > >> > > >> > > > >> > > >> > >> > >> > >> -- > >> Chris Smith > >> http://www.chrisjsmith.me.uk/ > >> > >> > > > > > > > > > > > > > -- > Chris Smith > http://www.chrisjsmith.me.uk/ > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
