You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Albert Lee (JIRA)" <ji...@apache.org> on 2010/03/25 04:13:36 UTC

[jira] Created: (OPENJPA-1599) Cache mode properties passes in to em.find and lock methods are not transient

Cache mode properties passes in to em.find and lock methods are not transient
-----------------------------------------------------------------------------

                 Key: OPENJPA-1599
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1599
             Project: OpenJPA
          Issue Type: Bug
          Components: jpa
    Affects Versions: 2.0.0-beta2, 2.0.0-beta3, 2.0.0
            Reporter: Albert Lee
            Assignee: Albert Lee
             Fix For: 2.0.0


Cache mode properties passes in to em.find and lock methods are not transient and permanently
set to the entity manager, which caused subsequent em operations to use the undesired
cache mode.

    public <T> T find(Class<T> cls, Object oid, LockModeType mode, Map<String, Object> properties) {
        assertNotCloseInvoked();
        configureCurrentCacheModes(getFetchPlan(), properties);  <<---- pushFetchPlan call should be performed first before the getFetchPlan
        configureCurrentFetchPlan(pushFetchPlan(), properties, mode, true);
        try {
            oid = _broker.newObjectId(cls, oid);
            return (T) _broker.find(oid, true, this);
        } finally {
            popFetchPlan();
        }
    }


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


[jira] Resolved: (OPENJPA-1599) Cache mode properties passes in to em.find and lock methods are not transient

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

Donald Woods resolved OPENJPA-1599.
-----------------------------------

    Resolution: Fixed

Code checked into 2.0.0, so marking it resolved for the release notes.
If more work is required, please open a new issue and link it to this one.


> Cache mode properties passes in to em.find and lock methods are not transient
> -----------------------------------------------------------------------------
>
>                 Key: OPENJPA-1599
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1599
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0-beta2, 2.0.0-beta3, 2.0.0
>            Reporter: Albert Lee
>            Assignee: Albert Lee
>             Fix For: 2.0.0
>
>
> Cache mode properties passes in to em.find and lock methods are not transient and permanently
> set to the entity manager, which caused subsequent em operations to use the undesired
> cache mode.
>     public <T> T find(Class<T> cls, Object oid, LockModeType mode, Map<String, Object> properties) {
>         assertNotCloseInvoked();
>         configureCurrentCacheModes(getFetchPlan(), properties);  <<---- pushFetchPlan call should be performed first before the getFetchPlan
>         configureCurrentFetchPlan(pushFetchPlan(), properties, mode, true);
>         try {
>             oid = _broker.newObjectId(cls, oid);
>             return (T) _broker.find(oid, true, this);
>         } finally {
>             popFetchPlan();
>         }
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OPENJPA-1599) Cache mode properties passes in to em.find and lock methods are not transient

Posted by "Albert Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849941#action_12849941 ] 

Albert Lee commented on OPENJPA-1599:
-------------------------------------

Cache*Mode property processing in em method call modified (removed) the processed property from user's input properties Map, which is not part of the em contract and potentially causes application side effect.

> Cache mode properties passes in to em.find and lock methods are not transient
> -----------------------------------------------------------------------------
>
>                 Key: OPENJPA-1599
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1599
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0-beta2, 2.0.0-beta3, 2.0.0
>            Reporter: Albert Lee
>            Assignee: Albert Lee
>             Fix For: 2.0.0
>
>
> Cache mode properties passes in to em.find and lock methods are not transient and permanently
> set to the entity manager, which caused subsequent em operations to use the undesired
> cache mode.
>     public <T> T find(Class<T> cls, Object oid, LockModeType mode, Map<String, Object> properties) {
>         assertNotCloseInvoked();
>         configureCurrentCacheModes(getFetchPlan(), properties);  <<---- pushFetchPlan call should be performed first before the getFetchPlan
>         configureCurrentFetchPlan(pushFetchPlan(), properties, mode, true);
>         try {
>             oid = _broker.newObjectId(cls, oid);
>             return (T) _broker.find(oid, true, this);
>         } finally {
>             popFetchPlan();
>         }
>     }

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