OpenJPA
  1. OpenJPA
  2. OPENJPA-1205

Cannot retrieve Map<PersistenceCapable, PersistenceCapable> fields when DataCache is on

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 2.0.0-M3
    • Component/s: datacache
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      Consider the following mapping, which uses a Map of a PC class to another PC class:

      @OneToMany(targetEntity = CatalogProductPriceImpl.class, cascade =

      { CascadeType.ALL }

      )
      @MapKey(name = "catalog")
      public Map<Catalog, CatalogPrice> getCatalogPrices()

      { return catalogPrices; }

      With the DataCache on, when a product is retrieved for the first time, this map will be correct. However, the next time it is retrieved (i.e. from the cache), what is returned is a Map<LongId, CatalogPrice> not the expected Map<Catalog, CatalogPrice>.

      The attached patch resolves this issue.

        Issue Links

          Activity

          Hide
          Donald Woods added a comment -

          Fixed by OPENJPA-1232 in r802211

          Show
          Donald Woods added a comment - Fixed by OPENJPA-1232 in r802211
          Hide
          Simon Droscher added a comment -

          The fix in OPENJPA-1232 is essentially the same change as that in my patch to this issue. So yes, it does appear to resolve this issue.

          Show
          Simon Droscher added a comment - The fix in OPENJPA-1232 is essentially the same change as that in my patch to this issue. So yes, it does appear to resolve this issue.
          Hide
          Donald Woods added a comment -

          Does the fix for OPENJPA-1232 in 2.0.0-M3 or later resolve this issue?

          Show
          Donald Woods added a comment - Does the fix for OPENJPA-1232 in 2.0.0-M3 or later resolve this issue?
          Hide
          Donald Woods added a comment -

          Can you attach a patch that adds or modifies an existing junit testcase to demonstrate the original failure?

          Show
          Donald Woods added a comment - Can you attach a patch that adds or modifies an existing junit testcase to demonstrate the original failure?
          Hide
          Simon Droscher added a comment -

          OPENJPA-589 fixes a similar issue with the value of the map, but the error can still occur with the key of the map.

          Show
          Simon Droscher added a comment - OPENJPA-589 fixes a similar issue with the value of the map, but the error can still occur with the key of the map.

            People

            • Assignee:
              Unassigned
              Reporter:
              Simon Droscher
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development