[OS-JIRA] Created: (CAY-360) Non-refreshed Named Queries in Modeler throw exception

From: jira-norepl..bjectstyle.org
Date: Thu Sep 01 2005 - 09:50:59 EDT

  • Next message: jira-norepl..bjectstyle.org: "[OS-JIRA] Created: (CAY-361) DbEntity "generated" checkbox is confusing"

    Message:

      A new issue has been created in JIRA.

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

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

    Here is an overview of the issue:
    ---------------------------------------------------------------------
            Key: CAY-360
        Summary: Non-refreshed Named Queries in Modeler throw exception
           Type: Bug

         Status: Assigned
       Priority: Major

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

       Assignee: Andrus Adamchik
       Reporter: Michael Gentry

        Created: Thu, 1 Sep 2005 9:50 AM
        Updated: Thu, 1 Sep 2005 9:50 AM
    Environment: All

    Description:
    Jeff de Vries was reporting problems on the Cayenne User list regarding having a named query defined in Cayenne Modeler, but getting an exception (Caching of unnamed queries is not supported.) when he used a Shared/DataContext cache and didn't refresh result. An example of the calling code is:

    dataContext.performQuery("MyQuery", false);

    Researching the issue I discovered:

    DataContext.performQuery(String, boolean) ->
      DataContext.performQuery(String, Map, boolean) ->
        (actual named query) SelectQuery.createQuery((Map) ->
          SelectQuery.queryWithParameters(Map) ->
            SelectQuery.queryWithParameters(Map, boolean)

    This final method creates a new SelectQuery (local variable "query") and and copies data from the original query into the new one, but omitted copying the query name, hence the exception listed above.

    There is a comment at the bottom of this method which states:

    // TODO: implement algorithm for building the name based on the original name and
    // the hashcode of the map of parameters. This way query clone can take advantage
    // of caching.

    Should discuss on Cayenne Developer if it is OK to copy the name or if we should MD5/etc the name.

    /dev/mrg

    PS. This effects 1.1 and 1.2.

    ---------------------------------------------------------------------
    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 : Thu Sep 01 2005 - 09:51:00 EDT