openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Dick (JIRA)" <>
Subject [jira] Commented: (OPENJPA-738) QueryCache Improvement
Date Wed, 08 Oct 2008 21:39:44 GMT


Michael Dick commented on OPENJPA-738:

The biggest issue I have with the patch is the interface changes. Adding methods to an interface
in trunk is acceptable, but introducing them into a service release (1.2.1 or 1.2.2) can cause
too much churn for downstream consumers. 

Updating the abstract classes we include can lessen the impact to third party cache plugins.
Extending the abstract classes is recommended but is not required - if we put the change as
is into a service release we could break other L2 query caches. 

> QueryCache Improvement
> ----------------------
>                 Key: OPENJPA-738
>                 URL:
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: datacache
>    Affects Versions: 1.2.0, 1.2.1, 1.3.0
>            Reporter: Sandhya
>         Attachments: OPENJPA-738.2.patch, OPENJPA-738.patch
> Hi All,
>       I have changed the jpa code to eliminate the scan of the jpa query cache to invalidate
cached queries that is triggered by entity bean values changes. The problem with the current
code is that whenever an entity bean value changes, the query cache needs to be scanned and
all the queries that are related to the changed entity bean should be invalidated. This is
resulting in poor performance when the querycache has too many queries in it. 
>       The new approach is to track the timestamp of the query and the timestamp of last
update for each entity class and compare the timestamps when retrieving the query for reuse.
 If the timestamp of the query result is older than the last update time of any entity in
the access path of the query,  the query result would not be reused and the query result would
be evicted from the query cache. 
>       I introduced a configurable attribute in the persistence.xml in QueryCache property
"evictOnTimestamp=true". Therefore the QueryCache property in persistence.xml file looks as
>       <property name="openjpa.QueryCache" value = "CacheSize=1000, evictOnTimestamp=true"
>       If the "evictOnTimestamp" value is set to true in the xml file the new code is
invoked otherwise the old code. The default behaviour would be the old code. That is the value
for "evictOnTimestamp" is false by default so that if this property is not set persistence.xml,
old code gets invoked. 
>       In the process of changing the code to evict the queries using the timestamp, I
had to introduce 4 methods in QueryCache interface. We want this change to be applied to JPA
trunk and 1.2.x branch. Anyone who is extending the QueryCache that implements this interface
would have to implement these 4 methods. Please respond as soon as possible if this interface
change is an issue. 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message