JBoss.orgCommunity Documentation

Chapter 9. Runtime Updates

9.1. Data Updates
9.2. Runtime Metadata Updates
9.2.1. Costing Updates
9.2.2. Schema Updates

Teiid supports several mechanisms for updating the runtime system.

Data change events are used by Teiid to invalidate result set cache entries. Result set cache entires are tracked by the tables that contributed to their results. By default Teiid will capture internal data events against physical sources and distribute them across the cluster. This approach has several limitations. First updates are scoped only to their originating VDB/version. Second updates made out side of Teiid are not captured. To increase data consistency external change data capture tools can be used to send events to Teiid. From within a Teiid cluster the org.teiid.events.EventDistributorFactory and org.teiid.events.EventDistributor can be used to distribute change events. The EventDistributorFactory is implemented by the RuntimeEngineDeployer bean and should be looked up by its name "teiid/engine-deployer". See the example below.


When externally capturing all update events, <jboss-install>/server/<profile>/deploy/teiid/teiid-jboss-beans.xml RuntimeEngineDeployer.detectingChangeEvents can be set to false, to not duplicate change events.

The use of the other EventDistributor methods to manual distribute other events is not recommended.

Runtime updates via system procedures and DDL statements are by default ephemeral. They are effective across the cluster only for the currently running vdbs. With the next vdb start the values will revert to whatever is stored in the vdb. Updates may be made persistent though by configuring a org.teiid.metadata.MetadataRepository. An instance of a MetadataRepository can be installed via the <jboss-install>/server/<profile>/deploy/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml file in the VDBRepository bean. The MetadataRepository repository instance may fully implement as many of the methods as needed and return null from any unneeded getter.

org.teiid.metadata.AbstractMetadataRecord objects passed to the MetadataRepository have not yet been modified. If the MetadataRepository cannot persist the update, then a RuntimeException should be thrown to prevent the update from being applied by the runtime engine.