2 Replies Latest reply on Mar 24, 2014 4:25 PM by Steven Hawkins

    about The multisource for help

    lei wang Newbie

      Some Day ago I have ask for help, details in the link is :https://community.jboss.org/thread/238054


      Now I'm using multiple source previous questions,but there are still some questions:

      The VDBs configure is:

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
      <vdb name="SybiqVDB" version="1"> 
      <description>My sybiq VDB</description> 
      <property name="UseConnectorMetadata" value="true" /> 
      <model visible="true" type="PHYSICAL" name="sybiq"> 
      <property name="importer.useFullSchemaName" value="true"/> 
      <property name="supports-multi-source-bindings" value="true"/> 
      <source name="sybiq21" translator-name="sybase" connection-jndi-name="java:sybiq21DS"/> 
      <source name="sybiq22" translator-name="sybase" connection-jndi-name="java:sybiq22DS"/> 

      DataSource sybiq21(sybiq22) configure is:

      <datasource jndi-name="java:/sybiq21DS" pool-name="sybiq21DS" enabled="true" use-java-context="true">  
      <datasource jndi-name="java:/sybiq22DS" pool-name="sybiq22DS" enabled="true" use-java-context="true">  

      The VDBs is running,no error.

           Data source “sybiq21” have two table that table  user_tb(userna varchar(12),passw  varchar(12)) and table vmt_tb(name varchar(16),count int)

           Data source “sybiq22” have   table vmt_tb(name varchar(16),count int)


      Now I want to query the VDBs,How can I set Data sources to make the following SQL statements are normal

           query the table vmt_tb's sql: select name ,count from vmt_tb

           query the table user_tb's sql : select userna , passw form user_tb

      I also want to know, when disconnected sybiq21 data source, how to set up the data source or VDBs, can make the VDBs at startup without verifying the validity of data source sybiq21, only when the data source is used to verify

        • 1. Re: about The multisource for help
          Ramesh Reddy Master

          When working with "multi-source", all the data sources must have exact schema. i.e. they should have same tables in both data sources. In your case "vmt_tb" is in both data sources but not "user_tb"


          So you can query : "select name, count from vmt_db"  using JDBC

          But, you will fail to issue query "select userna, passw from user_tb"


          Only *first time* you deploy the VDB the VDB requires "sybiq21" data source for reading the metadata. After that when you restart the server, you do not need "sybiq21" as the metadata will be cached because if you used the property

          <property name="UseConnectorMetadata" value = "cached"/>


          in your VDB. So , modify it.


          1 of 1 people found this helpful
          • 2. Re: about The multisource for help
            Steven Hawkins Master

            Just a quick note that with Teiid 8.4 UseConnectorMetadata was deprecated.  There is no need to set something like UseConnectorMetadata=true as we will automatically infer that from the model/source definition.  There is now a cache-metadata vdb and model level boolean property that can be used to specifically enable/disable metadata caching (defaults to false for vdb.xml deployments, and true for .vdb deployments).