Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EclipseLink/Development/JPA 2.0/cache api"
< EclipseLink | Development | JPA 2.0
Line 21: | Line 21: | ||
The Cache API consists of following 4 methods | The Cache API consists of following 4 methods | ||
− | #contains(Class cls, Object primaryKey) --- | + | #contains(Class cls, Object primaryKey) --- checks whether the class with the specified primary key |
− | #evict(Class cls, Object primaryKey) --- | + | #: is contained in IdentityMap. |
− | #evict(Class cls) --- | + | #evict(Class cls, Object primaryKey) --- invalidates the specified object in the IdentityMap |
− | #evictAll() --- | + | #evict(Class cls) --- invalidates the specified class in the IdentityMap. |
+ | #evictAll() --- Invalidates all classes in the IdentityMap. |
Revision as of 16:55, 17 March 2009
Contents
Cache APIs
JPA 2.0 Root | Enhancement Request
Issue Summary
In JPA 2.0 the specification has added a Cache API obtainable from a EntityManagerFactory. This simple API provides developers with rudimentary access and control of a second level cache. User's can interrogate the cache through a 'contains' API and cause cached data to be evicted from the cache through 'evict' API.
See JPA 2.0 ED section 5.10 for details.
General Solution
Should be simple to equate evict to invalidate.
Work Required
- Develop tests
- approx 1 day
- Implement API
- approx 2 days
Implementation Details
The Cache API consists of following 4 methods
- contains(Class cls, Object primaryKey) --- checks whether the class with the specified primary key
- is contained in IdentityMap.
- evict(Class cls, Object primaryKey) --- invalidates the specified object in the IdentityMap
- evict(Class cls) --- invalidates the specified class in the IdentityMap.
- evictAll() --- Invalidates all classes in the IdentityMap.