[ https://issues.apache.org/jira/browse/IBATISNET-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12591408#action_12591408 ]
David Marzo commented on IBATISNET-253: --------------------------------------- The change in the file trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ByteArrayTypeHandler.cs from 476843 to 60914 makes that fail if you try to read a column of type byte[] with DBNull.Value restore to 476843 work for this scenario. I don't search for a Test that cover this. > N+1 issue when using sql timestamp data type > -------------------------------------------- > > Key: IBATISNET-253 > URL: https://issues.apache.org/jira/browse/IBATISNET-253 > Project: iBatis for .NET > Issue Type: Bug > Components: DataMapper > Affects Versions: DataMapper 1.6.1 > Environment: Visual Studio 2005 > SQL Server 2005 > Reporter: Anthony Seddon > Assignee: Gilles Bayon > Fix For: DataMapper 1.6.2 > > Attachments: iBatisTest.zip > > > Select N+1 produces unexpected results when using SQL timestamp data type. > Created tables in SQL 2005 as follows: > Parent table with Id (int), Description (varchar) and RowVersion (timestamp) > fields > Child table with Id (int), ParentId (int), Description (varchar) and > RowVersion (timestamp) fields > Added 2 records to Parent table > Added 2 records to Child table with ParentId = 1 > Created N+1 select statement joining the 2 tables as follows: > SELECT Parent.Id Parent_Id, Parent.RowVersion Parent_RowVersion, > Parent.Description Parent_Description, > Child.Id Child_Id, Child.RowVersion Child_RowVersion, Child.ParentId > Child_ParentId, Child.Description Child_Description > FROM Parent LEFT JOIN Child ON Parent.Id = Child.ParentId > Running the above statement via iBatis results in 2 Parent objects returned, > the 2nd one having an unexpected Child > Created a different N+1 select statement joining the 2 tables as follows: > SELECT Parent.Id Parent_Id, Parent.RowVersion Parent_RowVersion, > Parent.Description Parent_Description, > Child.Id Child_Id, NULL Child_RowVersion, Child.ParentId > Child_ParentId, Child.Description Child_Description > FROM Parent LEFT JOIN Child ON Parent.Id = Child.ParentId > Running the above statement via iBatis results in 2 Parent objects returned, > the 2nd one having no children, as expected > It appears that the the fact that Child_RowVersion = 0x (as when viewed in a > query in SQL Management Studio) iBatis creates a Child object in error. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.