Use eclipselink.cache.database-event-listener
to integrate EclipseLink with a database event notification service, such as Oracle QCN/DCN (Query Change Notification/Database Change Notification).
Values
Table 5-20 describes this persistence property's values.
Table 5-20 Valid Values for cache.database-event-listener
Value | Description |
---|---|
Class |
The name of a class that implements You can also use DCN and QCN for Oracle. |
Usage
You can use this property to allow the EclipseLink cache to be invalidated by database change events, triggers, or other services.
Examples
Example 5-9 shows how to use this property with Oracle DCN.
Example 5-9 Using cache.database-event-listener in persistence.xml
<?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence persistence_2_0.xsd" version="2.0"> <persistence-unit name="acme" transaction-type="RESOURCE_LOCAL"> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <exclude-unlisted-classes>false</exclude-unlisted-classes> <properties> <property name="eclipselink.cache.database-event-listener" value="org.eclipse.persistence.platform.database.oracle.dcn.OracleChangeNotificationListener"/> </properties> </persistence-unit> </persistence>
See Also
For more information, see:
"Cache Coordination" in Understanding EclipseLink
"Scaling EclipseLink Applications in Clusters" in Solutions Guide for EclispeLink
"Database Change Notification" in Oracle Fusion Middleware Configuring and Managing JDBC Data Sources for Oracle WebLogic Server
"Clustering and Cache Coordination"
http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Caching/Coordination
Cache Coordination Example
http://wiki.eclipse.org/EclipseLink/Examples/JPA/CacheCoordination