Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/Development/JPA 2.0/cache api"

m (Cache APIs)
Line 3: Line 3:
 
[http://bugs.eclipse.org/248780 Enhancement Request]
 
[http://bugs.eclipse.org/248780 Enhancement Request]
 
==Issue Summary==
 
==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.
+
In JPA 2.0 the specification has added a Cache API obtainable from an 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(Class, Object)''' API call and cause cached data to be evicted from the cache through an '''evict(Class, Object)''', '''evict(Class)''' or '''evictAll()''' API call.
  
See JPA 2.0 ED section 7.10 for details.
+
See The JPA 2.0 Final Release Specification section 7.10 ''p.306'' for details.
  
 
==General Solution==
 
==General Solution==
Line 26: Line 26:
 
#evict(Class cls) --- invalidates the specified class in the IdentityMap.
 
#evict(Class cls) --- invalidates the specified class in the IdentityMap.
 
#evictAll() --- Invalidates all classes in the IdentityMap.
 
#evictAll() --- Invalidates all classes in the IdentityMap.
 +
 +
==ReImplementation 20100322==
 +
*The following details describe changes to the original [http://fisheye2.atlassian.com/changelog/~author=mmeswani/eclipselink/?cs=2896 SVN 2896] implemenation of Dec 2008 that will arrive in Trunk around April 2010.
 +
===Analysis===
 +
===Design===
 +
===Implementation===
 +
===Testing===
 +
==References==

Revision as of 11:24, 22 March 2010

Cache APIs

JPA 2.0 Root | Enhancement Request

Issue Summary

In JPA 2.0 the specification has added a Cache API obtainable from an 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(Class, Object) API call and cause cached data to be evicted from the cache through an evict(Class, Object), evict(Class) or evictAll() API call.

See The JPA 2.0 Final Release Specification section 7.10 p.306 for details.

General Solution

Should be simple to equate evict to invalidate.

Work Required

  1. Develop tests
    approx 1 day
  2. Implement API
    approx 2 days

Implementation Details

The Cache API consists of following 4 methods

  1. contains(Class cls, Object primaryKey) --- checks whether the class with the specified primary key
    is contained in IdentityMap.
  2. evict(Class cls, Object primaryKey) --- invalidates the specified object in the IdentityMap
  3. evict(Class cls) --- invalidates the specified class in the IdentityMap.
  4. evictAll() --- Invalidates all classes in the IdentityMap.

ReImplementation 20100322

  • The following details describe changes to the original SVN 2896 implemenation of Dec 2008 that will arrive in Trunk around April 2010.

Analysis

Design

Implementation

Testing

References

Back to the top