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

Query cache excess eviction with InheritanceType.TABLE_PER_CLASS

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.0
    • Fix Version/s: None
    • Component/s: datacache
    • Labels:
    • Environment:
      WinXP SP3, JDK 1.6.0_21, Postgres

      Description

      Test configuration:

      @Entity
      @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
      public abstract class Parent

      { ... }

      and some inheritors

      @Entity
      public class ChildA extends Base { ... }

      @Entity
      public class ChildB extends Base

      { ... }

      Parent class has some fields which are used both in ChildA and ChildB classes but these fields are in separate tables (for ChildA and ChildB class) with no common table.

      Test case:
      0. Use VM argument -Dopenjpa.Log=SQL=TRACE,Runtime=TRACE
      1. Create an object of ChildA entity.
      2. Execute query "SELECT x FROM ChildA x WHERE x.value = 'ValueA'".
      3. Execute this query one more time to ensure its result is cached.
      4. Create an object of ChildB entity.
      5. Execute query "SELECT x FROM ChildA x WHERE x.value = 'ValueA'".
      The query result is not cached, SQL is executed

      This test case can be found in attachement. JUnit test itself runs successfully, so please, pay attention to openjpa logs. Also attached my junit test log.

      Original discussion: http://openjpa.208410.n2.nabble.com/Query-cache-eviction-problem-with-InheritanceType-TABLE-PER-CLASS-td6381734.html

        Attachments

        1. openjpa_querycache.log
          11 kB
          Oleg Lyalikov
        2. openjpa_querycache.zip
          7 kB
          Oleg Lyalikov

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              oleg.lyalikov Oleg Lyalikov
            • Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: