You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "David Minor (JIRA)" <ji...@apache.org> on 2009/08/05 18:28:14 UTC

[jira] Created: (OPENJPA-1227) SQL generation error when using data cache

SQL generation error when using data cache
------------------------------------------

                 Key: OPENJPA-1227
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1227
             Project: OpenJPA
          Issue Type: Bug
          Components: datacache, jdbc, sql
    Affects Versions: 1.2.1
            Reporter: David Minor


When the DataCacheStoreManager loads an object whose (table join strategy) superclass contains an eager to-many field, and this is the only field selected in the superclass, and when one or more fields are selected in the subclass, openjpa fails to create a join between the subclass and superclass.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-1227) SQL generation error when using data cache

Posted by "David Minor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Minor updated OPENJPA-1227:
---------------------------------

    Attachment: test-abstract-hierarchy-with-cache.patch

Test case patch against 1.2.1 which demonstrates the issue. Fetch groups turned out to be key to recreating.

> SQL generation error when using data cache
> ------------------------------------------
>
>                 Key: OPENJPA-1227
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1227
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, jdbc, sql
>    Affects Versions: 1.2.1
>            Reporter: David Minor
>         Attachments: openjpa_superclass_join.patch, test-abstract-hierarchy-with-cache.patch
>
>
> When the DataCacheStoreManager loads an object whose (table join strategy) superclass contains an eager to-many field, and this is the only field selected in the superclass, and when one or more fields are selected in the subclass, openjpa fails to create a join between the subclass and superclass.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Work started: (OPENJPA-1227) SQL generation error when using data cache

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on OPENJPA-1227 started by Donald Woods.

> SQL generation error when using data cache
> ------------------------------------------
>
>                 Key: OPENJPA-1227
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1227
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, jdbc, sql
>    Affects Versions: 1.2.1
>            Reporter: David Minor
>            Assignee: Donald Woods
>         Attachments: openjpa_superclass_join.patch, test-abstract-hierarchy-with-cache.patch
>
>
> When the DataCacheStoreManager loads an object whose (table join strategy) superclass contains an eager to-many field, and this is the only field selected in the superclass, and when one or more fields are selected in the subclass, openjpa fails to create a join between the subclass and superclass.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-1227) SQL generation error when using data cache

Posted by "David Minor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Minor updated OPENJPA-1227:
---------------------------------

    Attachment: openjpa_superclass_join.patch

The attached patch forces a join to the superclass table in the specific circumstances that I'm seeing the bug. However,

 1. The join is added to the base mapping select, but I am guessing it would be best to put it in the eager select only.
 2. While it only gets applied in the specific case I'm seeing, I don't understand the code well enough to know that it won't get applied in other cases which my application doesn't cover.

Hopefully someone who understands this code better can use this patch to figure out what's triggering this particular bug, and come up with a more robust solution.

> SQL generation error when using data cache
> ------------------------------------------
>
>                 Key: OPENJPA-1227
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1227
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, jdbc, sql
>    Affects Versions: 1.2.1
>            Reporter: David Minor
>         Attachments: openjpa_superclass_join.patch
>
>
> When the DataCacheStoreManager loads an object whose (table join strategy) superclass contains an eager to-many field, and this is the only field selected in the superclass, and when one or more fields are selected in the subclass, openjpa fails to create a join between the subclass and superclass.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-1227) SQL generation error when using data cache

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods resolved OPENJPA-1227.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0-M3
                   1.3.0

Committed to trunk as r814706.
Committed to 1.3.x as r814712.

Mike/David, please reopen if you want to apply to other branches.

> SQL generation error when using data cache
> ------------------------------------------
>
>                 Key: OPENJPA-1227
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1227
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, jdbc, sql
>    Affects Versions: 1.2.1
>            Reporter: David Minor
>            Assignee: Donald Woods
>             Fix For: 1.3.0, 2.0.0-M3
>
>         Attachments: openjpa_superclass_join.patch, test-abstract-hierarchy-with-cache.patch
>
>
> When the DataCacheStoreManager loads an object whose (table join strategy) superclass contains an eager to-many field, and this is the only field selected in the superclass, and when one or more fields are selected in the subclass, openjpa fails to create a join between the subclass and superclass.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-1227) SQL generation error when using data cache

Posted by "David Minor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739595#action_12739595 ] 

David Minor commented on OPENJPA-1227:
--------------------------------------

See http://n2.nabble.com/SQL-generation-error-td3379974.html for some discussion.

> SQL generation error when using data cache
> ------------------------------------------
>
>                 Key: OPENJPA-1227
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1227
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, jdbc, sql
>    Affects Versions: 1.2.1
>            Reporter: David Minor
>
> When the DataCacheStoreManager loads an object whose (table join strategy) superclass contains an eager to-many field, and this is the only field selected in the superclass, and when one or more fields are selected in the subclass, openjpa fails to create a join between the subclass and superclass.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (OPENJPA-1227) SQL generation error when using data cache

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods reassigned OPENJPA-1227:
-------------------------------------

    Assignee: Donald Woods

> SQL generation error when using data cache
> ------------------------------------------
>
>                 Key: OPENJPA-1227
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1227
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, jdbc, sql
>    Affects Versions: 1.2.1
>            Reporter: David Minor
>            Assignee: Donald Woods
>         Attachments: openjpa_superclass_join.patch, test-abstract-hierarchy-with-cache.patch
>
>
> When the DataCacheStoreManager loads an object whose (table join strategy) superclass contains an eager to-many field, and this is the only field selected in the superclass, and when one or more fields are selected in the subclass, openjpa fails to create a join between the subclass and superclass.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.