OpenJPA
  1. OpenJPA
  2. OPENJPA-1599

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-beta2, 2.0.0-beta3, 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: jpa
    • Labels:
      None

      Description

      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(); }

      }

        Activity

        Hide
        Albert Lee added a comment -

        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.

        Show
        Albert Lee added a comment - 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.
        Hide
        Donald Woods added a comment -

        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.

        Show
        Donald Woods added a comment - 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.

          People

          • Assignee:
            Albert Lee
            Reporter:
            Albert Lee
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development