Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.0.0
-
None
-
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