You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Gilles Bayon (JIRA)" <ib...@incubator.apache.org> on 2008/04/30 06:52:55 UTC

[jira] Closed: (IBATISNET-253) N+1 issue when using sql timestamp data type

     [ https://issues.apache.org/jira/browse/IBATISNET-253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gilles Bayon closed IBATISNET-253.
----------------------------------

    Resolution: Fixed

In SVN

> 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.