openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Lyalikov (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (OPENJPA-2002) Query cache excess eviction with InheritanceType.TABLE_PER_CLASS
Date Tue, 24 May 2011 13:00:47 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-2002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oleg Lyalikov updated OPENJPA-2002:
-----------------------------------

    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

  was:
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.


> 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
>              Labels: QueryCache
>         Attachments: openjpa_querycache.log, 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.
> Original discussion: http://openjpa.208410.n2.nabble.com/Query-cache-eviction-problem-with-InheritanceType-TABLE-PER-CLASS-td6381734.html

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message