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

Query SQL Cache issue with NULL parameters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.0, 2.1.1, 2.2.0
    • 2.1.2, 2.2.1, 2.3.0
    • query
    • None

    Description

      The Query SQL Cache matches previously executed SQL for a given JPQL by using the JPQL string itself for the key. As long as none of the predicate parameters are NULL, this is fine, as the prepared statement's SQL remains unchanged. Since SQL requires "column IS NULL" statements and not "column = NULL", the approach used by OpenJPA's Query SQL Cache breaks and results with bad getResultList() returns.

      In the future (say, trunk), the Query SQL Cache needs more intelligence to handle this situation, but for service releases the best way to handle this issue is to disqualify queries with NULL parameters from the query cache.

      Attachments

        Activity

          People

            fyrewyld Jody Grassel
            fyrewyld Jody Grassel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: