From: Neal G. (JIRA) <nh...@gm...> - 2011-04-20 18:15:31
|
NHibernate cannot handle SQL Server TIME columns when built with the .NET 4 framework ------------------------------------------------------------------------------------- Key: NH-2661 URL: http://216.121.112.228/browse/NH-2661 Project: NHibernate Issue Type: Bug Components: Core Affects Versions: 3.1.0, 3.0.0.GA, 3.0.0.CR1, 3.0.0.Beta2, 3.0.0.Beta1, 3.0.0.Alpha3, 3.0.0.Alpha2, 3.0.0.Alpha1, 2.1.2.GA, 2.1.1.GA Reporter: Neal Groothuis Priority: Minor In .NET 4, setting a SqlParameter's DbType to Time does not work; it will be set to DateTime instead. (http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.100%29.aspx , c.f. http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.90%29.aspx ). To set a SqlParameter's DbType to Time, you actually have to set the SqlDbType property to SqlDbType.Time. Unfortunately, this renders NHibernate unable to access TIME columns in the database if being used in .NET 4.0. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Neal G. (JIRA) <nh...@gm...> - 2011-04-20 18:31:34
|
[ http://216.121.112.228/browse/NH-2661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Neal Groothuis updated NH-2661: ------------------------------- Attachment: NHibernate.Test-2661.zip Unit test illustrating the problem. This includes a custom TimeType which works around the problem in NH-2660. > NHibernate cannot handle SQL Server TIME columns when built with the .NET 4 framework > ------------------------------------------------------------------------------------- > > Key: NH-2661 > URL: http://216.121.112.228/browse/NH-2661 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 2.1.1.GA, 2.1.2.GA, 3.0.0.Alpha1, 3.0.0.Alpha2, 3.0.0.Alpha3, 3.0.0.Beta1, 3.0.0.Beta2, 3.0.0.CR1, 3.0.0.GA, 3.1.0 > Reporter: Neal Groothuis > Priority: Minor > Attachments: NHibernate.Test-2661.zip > > > In .NET 4, setting a SqlParameter's DbType to Time does not work; it will be set to DateTime instead. (http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.100%29.aspx , c.f. http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.90%29.aspx ). To set a SqlParameter's DbType to Time, you actually have to set the SqlDbType property to SqlDbType.Time. > Unfortunately, this renders NHibernate unable to access TIME columns in the database if being used in .NET 4.0. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Neal G. (JIRA) <nh...@gm...> - 2011-04-20 18:33:34
|
[ http://216.121.112.228/browse/NH-2661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20927#action_20927 ] Neal Groothuis commented on NH-2661: ------------------------------------ I believe this can be fixed by having NHibernate.Driver.SqlClientDriver override InitializeParameter() and set the SqlDbType to Time if the DbType is Time. > NHibernate cannot handle SQL Server TIME columns when built with the .NET 4 framework > ------------------------------------------------------------------------------------- > > Key: NH-2661 > URL: http://216.121.112.228/browse/NH-2661 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 2.1.1.GA, 2.1.2.GA, 3.0.0.Alpha1, 3.0.0.Alpha2, 3.0.0.Alpha3, 3.0.0.Beta1, 3.0.0.Beta2, 3.0.0.CR1, 3.0.0.GA, 3.1.0 > Reporter: Neal Groothuis > Priority: Minor > Attachments: NHibernate.Test-2661.zip > > > In .NET 4, setting a SqlParameter's DbType to Time does not work; it will be set to DateTime instead. (http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.100%29.aspx , c.f. http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.90%29.aspx ). To set a SqlParameter's DbType to Time, you actually have to set the SqlDbType property to SqlDbType.Time. > Unfortunately, this renders NHibernate unable to access TIME columns in the database if being used in .NET 4.0. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-04-20 18:44:31
|
[ http://216.121.112.228/browse/NH-2661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo updated NH-2661: ---------------------------- Affects Version/s: (was: 3.0.0.GA) (was: 3.0.0.CR1) (was: 3.0.0.Beta2) (was: 3.0.0.Beta1) (was: 3.0.0.Alpha3) (was: 3.0.0.Alpha2) (was: 2.1.2.GA) (was: 2.1.1.GA) (was: 3.0.0.Alpha1) > NHibernate cannot handle SQL Server TIME columns when built with the .NET 4 framework > ------------------------------------------------------------------------------------- > > Key: NH-2661 > URL: http://216.121.112.228/browse/NH-2661 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.1.0 > Reporter: Neal Groothuis > Priority: Minor > Attachments: NHibernate.Test-2661.zip > > > In .NET 4, setting a SqlParameter's DbType to Time does not work; it will be set to DateTime instead. (http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.100%29.aspx , c.f. http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.90%29.aspx ). To set a SqlParameter's DbType to Time, you actually have to set the SqlDbType property to SqlDbType.Time. > Unfortunately, this renders NHibernate unable to access TIME columns in the database if being used in .NET 4.0. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-04-20 18:46:32
|
[ http://216.121.112.228/browse/NH-2661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo closed NH-2661. --------------------------- Resolution: External Issue http://connect.microsoft.com/VisualStudio/feedback/details/381934/sqlparameter-dbtype-dbtype-time-sets-the-parameter-to-sqldbtype-datetime-instead-of-sqldbtype-time Microsoft said: "Thanks for reporting this issue. This is a bug in our product, but after carefully investigating the issue, we have decided not to fix the bug. Fixing this bug will cause a breaking change and in most of customer scenarios, they should be able to use SqlParameter.SqlDbType. Please let us know if this is a blocking issue for some of your major scenarios." > NHibernate cannot handle SQL Server TIME columns when built with the .NET 4 framework > ------------------------------------------------------------------------------------- > > Key: NH-2661 > URL: http://216.121.112.228/browse/NH-2661 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.1.0 > Reporter: Neal Groothuis > Priority: Minor > Attachments: NHibernate.Test-2661.zip > > > In .NET 4, setting a SqlParameter's DbType to Time does not work; it will be set to DateTime instead. (http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.100%29.aspx , c.f. http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.90%29.aspx ). To set a SqlParameter's DbType to Time, you actually have to set the SqlDbType property to SqlDbType.Time. > Unfortunately, this renders NHibernate unable to access TIME columns in the database if being used in .NET 4.0. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Neal G. (JIRA) <nh...@gm...> - 2011-04-21 14:44:48
|
[ http://216.121.112.228/browse/NH-2661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20932#action_20932 ] Neal Groothuis commented on NH-2661: ------------------------------------ The exact code that I added to NHibernate.Driver.SqlClientDriver is: protected override void InitializeParameter(IDbDataParameter dbParam, string name, SqlType sqlType) { base.InitializeParameter(dbParam, name, sqlType); if (sqlType.DbType == DbType.Time) ((SqlParameter) dbParam).SqlDbType = SqlDbType.Time; } I verified that the unit test passes after I made this change (and updated the type of the "Data" property to reference my included custom TimeType). > NHibernate cannot handle SQL Server TIME columns when built with the .NET 4 framework > ------------------------------------------------------------------------------------- > > Key: NH-2661 > URL: http://216.121.112.228/browse/NH-2661 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.1.0 > Reporter: Neal Groothuis > Priority: Minor > Attachments: NHibernate.Test-2661.zip > > > In .NET 4, setting a SqlParameter's DbType to Time does not work; it will be set to DateTime instead. (http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.100%29.aspx , c.f. http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.90%29.aspx ). To set a SqlParameter's DbType to Time, you actually have to set the SqlDbType property to SqlDbType.Time. > Unfortunately, this renders NHibernate unable to access TIME columns in the database if being used in .NET 4.0. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-04-22 19:19:38
|
[ http://216.121.112.228/browse/NH-2661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo reopened NH-2661: ----------------------------- > NHibernate cannot handle SQL Server TIME columns when built with the .NET 4 framework > ------------------------------------------------------------------------------------- > > Key: NH-2661 > URL: http://216.121.112.228/browse/NH-2661 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.1.0 > Reporter: Neal Groothuis > Priority: Minor > Attachments: NHibernate.Test-2661.zip > > > In .NET 4, setting a SqlParameter's DbType to Time does not work; it will be set to DateTime instead. (http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.100%29.aspx , c.f. http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.90%29.aspx ). To set a SqlParameter's DbType to Time, you actually have to set the SqlDbType property to SqlDbType.Time. > Unfortunately, this renders NHibernate unable to access TIME columns in the database if being used in .NET 4.0. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-04-22 21:21:34
|
[ http://216.121.112.228/browse/NH-2661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20950#action_20950 ] Fabio Maulo commented on NH-2661: --------------------------------- Neal, you can't change the TimeType that way because not all RDBMS may accepts a TimeSpan in the value of a parameter of DbType.Time. In practice what you are looking for is something that use a DateTime in the domain and a TimeSpan for the DB. > NHibernate cannot handle SQL Server TIME columns when built with the .NET 4 framework > ------------------------------------------------------------------------------------- > > Key: NH-2661 > URL: http://216.121.112.228/browse/NH-2661 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.1.0 > Reporter: Neal Groothuis > Priority: Minor > Attachments: NHibernate.Test-2661.zip > > > In .NET 4, setting a SqlParameter's DbType to Time does not work; it will be set to DateTime instead. (http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.100%29.aspx , c.f. http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.90%29.aspx ). To set a SqlParameter's DbType to Time, you actually have to set the SqlDbType property to SqlDbType.Time. > Unfortunately, this renders NHibernate unable to access TIME columns in the database if being used in .NET 4.0. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-04-22 21:37:32
|
[ http://216.121.112.228/browse/NH-2661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20951#action_20951 ] Fabio Maulo commented on NH-2661: --------------------------------- Sorry I mean "we can't change". To work with pure Time we have TimeAsTimeSpan. I'll try to find a solution without break everything for those ppl using TimeType > NHibernate cannot handle SQL Server TIME columns when built with the .NET 4 framework > ------------------------------------------------------------------------------------- > > Key: NH-2661 > URL: http://216.121.112.228/browse/NH-2661 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.1.0 > Reporter: Neal Groothuis > Priority: Minor > Attachments: NHibernate.Test-2661.zip > > > In .NET 4, setting a SqlParameter's DbType to Time does not work; it will be set to DateTime instead. (http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.100%29.aspx , c.f. http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.90%29.aspx ). To set a SqlParameter's DbType to Time, you actually have to set the SqlDbType property to SqlDbType.Time. > Unfortunately, this renders NHibernate unable to access TIME columns in the database if being used in .NET 4.0. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-04-25 12:13:47
|
[ http://216.121.112.228/browse/NH-2661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-2661. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Alpha3 Implementing a new Drive for MsSQL2008 > NHibernate cannot handle SQL Server TIME columns when built with the .NET 4 framework > ------------------------------------------------------------------------------------- > > Key: NH-2661 > URL: http://216.121.112.228/browse/NH-2661 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.1.0 > Reporter: Neal Groothuis > Priority: Minor > Fix For: 3.2.0Alpha3 > > Attachments: NHibernate.Test-2661.zip > > > In .NET 4, setting a SqlParameter's DbType to Time does not work; it will be set to DateTime instead. (http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.100%29.aspx , c.f. http://msdn.microsoft.com/en-us/library/system.data.dbtype%28v=VS.90%29.aspx ). To set a SqlParameter's DbType to Time, you actually have to set the SqlDbType property to SqlDbType.Time. > Unfortunately, this renders NHibernate unable to access TIME columns in the database if being used in .NET 4.0. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |