This chapter describes EclipseLink Database Change Notification (DCN), which allows you to use caching with a shared database in JPA.
This chapter includes the following sections:
Use Case
Users want to use a shared cache with their JPA application, however, external applications update the same database data, or the cache is in a clustered environment. The cache may retain stale data.
Solution
EclipseLink provides an API which allows the database to notify EclipseLink of database changes. The changed objects can then be invalidated in the EclipseLink shared cache. Stale data can be discarded, even if other applications access the same data in the database.
Components
Oracle 11gR2 (11.2) (or higher) database
EclipseLink 2.4 or later.
EclipseLink library: eclipselink.jar
JDBC library: ojdbc6.jar
.
JPA library: persistence.jar
.
Sample
For sample files that illustrate the use of Database Change Notification and shared caching in an application that uses JPA, see "EclipseLink/Examples/JPA/DCN" in the EclipseLink documentation.