ResultSet cache not refreshing upon EventDistributor.dataModification call
jorgecmb Oct 20, 2016 2:43 PMHi guys,
I am calling the EventDistributor.dataModification method to refresh the result set cache when data is modified but it is not reloading the cache. Even after the ed.dataModification("BankVDB", 1, "bank", tableName); is executed, the "old" value is still returned until the TTL refreshes it.
Can someone, please, take a look at my configuration and try to shed some light on the issue?
Here is my java method to invalidate a table cache:
protected void invalidateCache(String tableName) { InitialContext ic; try { ic = new InitialContext(); EventDistributor ed = ((EventDistributorFactory) ic.lookup("teiid/event-distributor-factory")) .getEventDistributor(); ed.dataModification("BankVDB", 1, "bank", tableName); } catch (NamingException e) { LOG.debug("Failed to lookup JDV teiid EventDistributor. Stacktrace: " + e); } }
Here is my VDB.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <vdb name="BankVDB" version="1"> <description>VDB</description> <property name="UseConnectorMetadata" value="false" /> <model name="bank"> <property name="importer.useFullSchemaName" value="false"/> <property name="importer.importKeys" value="true"/> <property name="importer.tableTypes" value="TABLE,VIEW"/> <property name="importer.schemaPattern" value="BANK" /> <property name="importer.includeSynonyms" value="true" /> <source name="oracle" translator-name="oracle" connection-jndi-name="java:/Database"/> </model> <translator name="translator-oracle" type="oracle"> <property name="SupportsNativeQueries" value="true" /> </translator> </vdb>
Here are my DataSources, both for DB and Teiid:
<datasource jndi-name="java:/Database" pool-name="NextDS" enabled="true" statistics-enabled="true"> <connection-url>jdbc:oracle:thin:@localhost:1521:bank</connection-url> <driver-class>oracle.jdbc.OracleDriver</driver-class> <driver>oracle.jdbc.OracleDriver_12_1</driver> <pool> <min-pool-size>5</min-pool-size> <max-pool-size>50</max-pool-size> </pool> <security> <user-name>app_user</user-name> <password>oracle</password> </security> </datasource> <datasource jndi-name="java:/teiidDS" pool-name="teiidDS" enabled="true" use-java-context="true" use-ccm="true"> <connection-url>jdbc:teiid:BankVDB@mm://192.168.33.11:31000</connection-url> <driver>teiid</driver> <pool> <use-strict-min>false</use-strict-min> <flush-strategy>FailingConnectionOnly</flush-strategy> </pool> <security> <user-name>teiidUser</user-name> <password>Password123*</password> </security> <validation> <check-valid-connection-sql>select 1 from DUAL</check-valid-connection-sql> <validate-on-match>false</validate-on-match> <background-validation>true</background-validation> </validation> </datasource>
I can't see any exceptions being logged and I am positive that the EventDistributor.dataModification method is being called. I am using JBoss EAP 6.4 and JDV 6.2.
Please advise. Many thanks in advance.