Partial Results Mode

Latest response

I am struggling to get partial results mode working. I have two oracle databases in a multi-source setup. If one of these databases is down, the VDB should still provide results from the remaining one. I have set partialResultsMode=True on the conenction URL of the VDB, but this does not make any difference.
An clear example of how the enable this would be most welcome.
Ideally the partial results mode should work with an internal materialized view.

Responses

The multi-source definition needs to be correct, then adding partialResultsMode=true to the VDB Connection URL is all you need.

Example dynamic VDB:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vdb name="multi_basic" version="1">
<description/>
<property name="validationDateTime" value="Mon Oct 31 08:01:36 CDT 2016"/>
<property name="validationVersion" value="8.12.6"/>
<model name="multi_phy" type="PHYSICAL" visible="true">
<property name="multisource" value="true"/>
       <source connection-jndi-name="java:/deb" name="deb" translator-name="postgresql"/>
        <source connection-jndi-name="java:/dv63" name="dv63" translator-name="postgresql"/>
<metadata type="DDL"><![CDATA[
CREATE FOREIGN TABLE emp (
    id integer NOT NULL OPTIONS(NAMEINSOURCE '"id"', NATIVE_TYPE 'int4', CASE_SENSITIVE 'FALSE', FIXED_LENGTH 'TRUE', SEARCHABLE 'ALL_EXCEPT_LIKE'),
    name string(2147483647) OPTIONS(NAMEINSOURCE '"name"', NATIVE_TYPE 'text'),
        SOURCE_NAME string(50),
    CONSTRAINT pk_emp PRIMARY KEY(id)
) OPTIONS(UPDATABLE 'true',NAMEINSOURCE '"public"."emp"')
]]></metadata>
</model>

<model name="multiv" type="VIRTUAL" visible="true">
<property name="imports" value="multi"/>
<metadata type="DDL"><![CDATA[
CREATE VIEW empview (
    id integer,
    name string(100)
) 
AS
    SELECT * FROM multi_phy.emp 
]]></metadata>
</model>
</vdb>

Then connect jdbc:teiid:multi_basic@mm://127.0.0.1:31000;partialResultsMode=true

Deborah, Many thanks for the quick response. I replicated the example and found that it was working fine. It also helped me to find the reason why it was not working for me: I was making the changes to the URL directly into standalone.xml, but this was being overwritten by the data source definition in TEIID designer. After having this fixed it did work fine. However, I see some "odd" behavior. I have two data sources "A" and "B". Data Source "B" is down to begin with. When the VDB is started and the first query issued, it throws an error message for "B", but loads the internal materialized view for "A" and presents the results. So that is exactly as we want it. But after Time To Live (TTL) expires, I see again the error for source "B", but the internal cache is not refreshed with the content of source "A". Instead, the existing cache content is returned. Although the query returns results, any updates made to "A" are not loaded into cache. This situation persists until source "B" becomes available. Is there an explanation for this behavior?