Use eclipselink.cache.database-event-listener
to integrate TopLink with a database event notification service, such as Oracle QCN/DCN (Query Change Notification/Database Change Notification).
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. |
You can use this property to allow the TopLink cache to be invalidated by database change events, triggers, or other services.
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>
For more information, see:
"Cache Coordination" in Understanding Oracle TopLink
"Scaling TopLink Applications in Clusters" in Solutions Guide for Oracle TopLink
"Database Change Notification" in Administering JDBC Data Sources for Oracle WebLogic Server