-
Language:
English
-
Language:
English
Red Hat Training
A Red Hat training course is available for Red Hat JBoss Data Virtualization
Chapter 15. Runtime Updates
15.1. Data Updates
Data change events are used by JBoss Data Virtualization to invalidate resultset cache entries. Resultset cache entires are tracked by the tables that contributed to their results. By default JBoss Data Virtualization will capture internal data events against physical sources and distribute them across the cluster. This approach has a couple of limitations. First, updates are scoped only to their originating VDB/version. Second, updates made outside of JBoss Data Virtualization are not captured. To increase data consistency, external change data capture tools can be used to send events to JBoss Data Virtualization. From within a cluster the
org.teiid.events.EventDistributorFactory
and org.teiid.events.EventDistributor
can be used to distribute change events. The EventDistributorFactory
can be looked up by its name "teiid/event-distributor-factory". See the example below.
InitialContext ctx = new InitialContext(); EventDistributorFactory edf = (EventDistributorFactory)ctx.lookup("teiid/event-distributor-factory"); EventDistributor ed = edf.getEventDistributor(); ed.dataModification(vdbName, vdbVersion, schema, tableName);
This will distribute a change event for schema.tableName in VDB vdbName.vdbVersion.
When externally capturing all update events, the "detect-change-events" property in the "teiid" subsystem can be set to false, so change events will not be duplicated. By default, this property is set to true.
Use of other
EventDistributor
methods to manually distribute other events is not always necessary. See System Procedures in Red Hat JBoss Development Guide: Reference Material for SQL based updates.
Note
Using the
org.teiid.events.EventDistributor
interface you can also update runtime metadata. Refer to the API.