Community
Participate
Working Groups
Currently cache hits can only occur on an Id field, cache indexes should be supported to allow any singleResult query to obtain a cache hit on any indexed field. A common use case if when the object has a natural id, and a generated id as well. Cache hits are still desired on the natural id. Can also be useful for Oracle DCN to index object by its rowid.
Created attachment 198730 [details] adds cache index support and descriptor cache policy
Created attachment 200104 [details] updated patch
SVN trunk commit: Bug#350484 cache index support https://bugs.eclipse.org/bugs/show_bug.cgi?id=350484 Design, http://wiki.eclipse.org/EclipseLink/DesignDocs/350484 Code review: Gord Changes: - Added @CacheIndex, @CacheIndexes annotations, xml and JPA meta-data processing - Added 2-4 eclipselikn-orm schema - Added CachePolicy to encapsulate all cache functionality of a descriptor - Redirected all cache state/behavior to CachePolicy (old API still supported) - Added CacheIndex and support to CachePolicy - Changed primary key extraction from Expression to be able to extract any fields - Index objects in the session cache when read/build from row. - Removed duplicate postMerge event - Fixed field name uppercasing - Added map of cache index IdentityMaps to IdentityMapManager - Added clear method for clearing indexes, clear indexes when clearing cache - Methods to get/put CacheKey by index to IdentityMapManager - Added cache index check to ExpressionQueryMechanism cache check, always conform result with expression. - Added pre/postLogout Session events - Added extensive comments to mergeChangesOfWorkingCopyIntoOriginal - Added null check in merge to avoid double locking (all new objects were being locked twice) - Removed managed new object without change set merge case that cannot occur - Fixed @ClassExtractor to define required class type - Added evict with invalidation in cluster option to JPA Cache - Added index to core employee model and tests - Added @CacheIndex usage to JPA advanced model and tests to AdvancedQueryTestSuite
James, Was this support supposed to be added to the 2.3 schema?
I guess it doesn't really matter as long as it wasn't added in the 2.3 maintenance branch. the eclipselink_orm_2_3.xsd should be deleted from TRUNK anyway
James, There is a mistake in the BasicAccessor constructor, the last 3 lines of code look incorrect. The CacheIndex annotation is being processed both for m_cacheIndex and m_index. This looks like it would break the Index support.
Thanks for catching this Karen, will check in a fix soon.
fixed
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink