[OS-JIRA] Created: (CAY-115) Using DISTINCT when joining on to-many sometimes causes trouble

From: jir..bjectstyle.org
Date: Mon Apr 05 2004 - 00:36:06 EDT

  • Next message: Mike Kienenberger: "FWD: Oracle can't tell the difference between NULL and "" on update/insert"

    Message:

      A new issue has been created in JIRA.

    ---------------------------------------------------------------------
    View the issue:

      http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-115

    Here is an overview of the issue:
    ---------------------------------------------------------------------
            Key: CAY-115
        Summary: Using DISTINCT when joining on to-many sometimes causes trouble
           Type: Bug

         Status: Assigned
       Priority: Minor

        Project: Cayenne
     Components:
                 Cayenne Core Library
       Fix Fors:
                 1.1 [DEV]
       Versions:
                 1.0 [STABLE]
                 1.1 [DEV]

       Assignee: Andrus Adamchik
       Reporter: Andrus Adamchik

        Created: Mon, 5 Apr 2004 12:35 AM
        Updated: Mon, 5 Apr 2004 12:35 AM
    Environment: MS SQL Server, "text" columns

    Description:
    Originally reported by Bill Fan:

    SQL Server blows with exception "[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The text, ntext, or image data type cannot be selected as DISTINCT." when a DISTINCT is automatically added to the SELECT statement when joining on to-many.

    Possible fixes require either subquery support in translators (might be a good alternative fetch strategy in general), or doing "distinct" on ObjectId in-memory when processing result.

    The last strategy is hard to implement efficienly (skipping duplicate ResultSet rows without fully reading them)... The only implementation that comes to mind is actually building ObjectId out of every row and using a map in SelectObserver to verify that a give ID is not yet in the map.

    ---------------------------------------------------------------------
    JIRA INFORMATION:
    This message is automatically generated by JIRA.

    If you think it was sent incorrectly contact one of the administrators:
       http://objectstyle.org/jira/secure/Administrators.jspa

    If you want more information on JIRA, or have a bug to report see:
       http://www.atlassian.com/software/jira



    This archive was generated by hypermail 2.0.0 : Mon Apr 05 2004 - 00:36:08 EDT