EclipseLink/UserGuide/JPA/Basic JPA Development/Caching/Caching Overview
|Mailing List • Forums • IRC • mattermost|
|Open • Help Wanted • Bug Day|
The EclipseLink cache is an in-memory repository that stores recently read or written objects based on class and Id values. EclipseLink uses the cache to do the following:
- Improve performance by holding recently read or written objects and their relationships and accessing them in-memory to minimize database access.
- Manage locking and isolation level.
- Manage object identity.
EclipseLink offers an integrated and functional cache including the following features:
- Isolated persistence context cache (L1), and shared persistence unit cache (L2)
- Caching configurable at the Entity level, entities can be cached, or not, cached entities can reference non-cached entities
- Multiple cache type options (weak, soft, full, weak-cache, soft-cache)
- Configurable size
- Cache indexes
- In-memory querying and conforming
- Time to live, and daily cache invalidation
- Clustered cache coordination through RMI and JMS
- Database event driven cache invalidation and Oracle DCN/QCN
- Support for JPA 2.0 @Cachable configuraiton and API
- Extended JpaCache API
- Query cache
EclipseLink supports the following caching annotations:
EclipseLink also provides a number of persistence unit properties that you can specify to configure the EclipseLink cache (see How to Use the Persistence Unit Properties for Caching). These properties may compliment or provide an alternative to the usage of annotations.