Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1575

Query parameter on externalized field breaks Prepared Query Cache

    Details

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

      Description

      If field value has been externalized and the query is using a parameter for that field, caching its SQL breaks because re-parametrization of the SQL can not externalize the user supplied parameter value through the field. The worse is the query is cached anyway and its parameter substituted with (wrong) non-externalized, user-supplied value – resulting in wrong result.
      Currently we will detect such usage and exclude the the query being cached.
      However, we can consider a mechanics to capture the parametrized fields in a query expression tree and appropriately pass the user values through the fields' externalizer in future.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ppoddar@apache.org Pinaki Poddar
                Reporter:
                ppoddar@apache.org Pinaki Poddar
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: