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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

JIRA Cayenne - Dev
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