Query cache excess eviction with InheritanceType.TABLE_PER_CLASS
-----------------------------------------------------------------
Key: OPENJPA-2002
URL: https://issues.apache.org/jira/browse/OPENJPA-2002
Project: OpenJPA
Issue Type: Improvement
Components: datacache
Affects Versions: 2.0.0
Environment: WinXP SP3, JDK 1.6.0_21, Postgres
Reporter: Oleg Lyalikov
Attachments: openjpa_querycache.zip
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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira