JBoss Developer: Message List - How to add/remove source names at runtime in multi-source scenario?Most recent forum messageshttps://developer.jboss.org/community/teiid/dev?view=discussionsJive Engage2013-06-27T17:25:46Z2013-06-27T17:25:46ZenRe: How to add/remove source names at runtime in multi-source scenario?Steven Hawkins/people/shawkinsdo-not-reply@jboss.com2013-06-27T17:25:46Z2013-06-27T17:25:46Z<!-- [DocumentBodyStart:ffaeddff-9c16-47b6-8b19-eeaca04dca9a] --><div class="jive-rendered-content"><p>8.5 and likely 8.6 will still be based upon EAP 6.1 Alapha1 (or whatever community facing release may come next).&#160; A Wildfly based Teiid release (9.0) will begin development when they get to the end of their betas with a final Teiid release sometime early next year.</p><p style="min-height: 8pt; padding: 0px;">&#160;</p><p>Steve</p></div><!-- [DocumentBodyEnd:ffaeddff-9c16-47b6-8b19-eeaca04dca9a] --><img src='/beacon?t=1521469977468' />2013-06-27T17:25:46Z4 years 9 months ago0Re: How to add/remove source names at runtime in multi-source scenario?Mark Addleman/people/markaddlemando-not-reply@jboss.com2013-06-27T17:14:03Z2013-06-27T17:14:03Z<!-- [DocumentBodyStart:a6b1cd32-5d65-49c1-89c3-3ea4d8b08e9f] --><div class="jive-rendered-content"><p>This sound great.&#160; It will be a while before we can get our main product updated to 8.5 as it will require us to update to Wildfly.&#160; Perhaps we can get a test application without a lot of fuss.</p></div><!-- [DocumentBodyEnd:a6b1cd32-5d65-49c1-89c3-3ea4d8b08e9f] -->2013-06-27T17:14:03Z4 years 9 months ago10Re: How to add/remove source names at runtime in multi-source scenario?Steven Hawkins/people/shawkinsdo-not-reply@jboss.com2013-06-27T16:56:58Z2013-06-27T16:56:58Z<!-- [DocumentBodyStart:b0e5a391-a5a6-4e3d-a11a-25aa35b2ca77] --><div class="jive-rendered-content"><p><a class="jive-link-external-small" href="https://issues.jboss.org/browse/TEIID-2527" target="_blank">https://issues.jboss.org/browse/TEIID-2527</a> has been addressed for 8.5 Alpha1.&#160; You can add/remove sources from multisource models at will.&#160; The processing of a multisource plan will determine the set of multisource targets when the AccessNode is opened and add the appropriate nodes as children.&#160; If the plan is reused and the sources have changed since the last execution, it will regenerate the multisource access.&#160; If a source is added after a particular query starts, it will not be in the results.&#160; If a source is removed after a particular query starts, it will be treated as a null source which should in most situations allow the query to complete normally.</p><p style="min-height: 8pt; padding: 0px;">&#160;</p><p>This also means that the show plan will be a little different.&#160; If you get the plan prior to execution, the multisource access will appear as a single AccessNode.&#160; After execution and the plan will show the set of nodes actually accessed.&#160; An alternative would be to simply create an initial set of multisource targets at planning time.</p></div><!-- [DocumentBodyEnd:b0e5a391-a5a6-4e3d-a11a-25aa35b2ca77] -->2013-06-27T16:56:58Z4 years 9 months ago20Re: How to add/remove source names at runtime in multi-source scenario?Steven Hawkins/people/shawkinsdo-not-reply@jboss.com2013-06-14T12:27:28Z2013-06-14T12:27:28Z<!-- [DocumentBodyStart:e7479727-fa64-49cd-9a09-bd5c471bd3b1] --><div class="jive-rendered-content"><p>If you know the set of sources needed you can basically workaround this with:</p><p class="container" style="min-height: 8pt; padding: 0px;" title="Hint: double-click to select code">&#160;</p><div class="number1 alt2 line index0"><p class="number2 alt1 line index1"><code class="spaces xml">&#160;&#160;&#160; </code><code class="xml plain">&lt;</code><code class="keyword xml">model</code> <code class="color1 xml">type</code><code class="xml plain">=</code><code class="string xml">"PHYSICAL"</code> <code class="color1 xml">name</code><code class="xml plain">=</code><code class="string xml">"Customers"</code><code class="xml plain">&gt;</code></p><p class="number3 index2 alt2 line"><code class="spaces xml">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </code><code class="xml plain">&lt;</code><code class="keyword xml">property</code> <code class="color1 xml">name</code><code class="xml plain">=</code><code class="string xml">"multisource"</code> <code class="color1 xml">value</code><code class="xml plain">=</code><code class="string xml">"true"</code><code class="xml plain">/&gt;</code></p><p class="number3 index2 alt2 line" style="min-height: 8pt; padding: 0px;">&#160;</p><p class="index7 number8 alt1 line"><code class="spaces xml">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </code><code class="xml plain">&lt;</code><code class="keyword xml">source</code> <code class="color1 xml">name</code><code class="xml plain">=</code><code class="string xml">"real"</code></p><p class="number9 alt2 line index8"><code class="spaces xml">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </code><code class="color1 xml">translator-name</code><code class="xml plain">=</code><code class="string xml">"oracle"</code> <code class="color1 xml">connection-jndi-name</code><code class="xml plain">=</code><code class="string xml">"some jndi"</code><code class="xml plain">/&gt;</code></p><p class="alt1 line index9 number10"><code class="spaces xml">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </code><code class="xml plain">&lt;</code><code class="keyword xml">source</code> <code class="color1 xml">name</code><code class="xml plain">=</code><code class="string xml">"other"</code></p><p class="alt2 index10 line number11"><code class="spaces xml">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </code><code class="color1 xml">translator-name</code><code class="xml plain">=</code><code class="string xml">"dummy-loopback"</code><code class="xml plain">/&gt;</code></p><p class="number12 alt1 line index11"><code class="spaces xml">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </code><code class="xml plain">&lt;</code><code class="keyword xml">source</code> <code class="color1 xml">name</code><code class="xml plain">=</code><code class="string xml">"other1"</code></p><p class="number13 alt2 line index12"><code class="spaces xml">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </code><code class="color1 xml">translator-name</code><code class="xml plain">=</code><code class="string xml">"</code><code class="string xml">dummy-loopback</code><code class="string xml">"</code><code class="xml plain">/&gt;</code></p><p class="number13 alt2 line index12">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ...</p><p class="index13 number14 alt1 line"><code class="spaces xml">&#160;&#160;&#160; </code><code class="xml plain">&lt;/</code><code class="keyword xml">model</code><code class="xml plain">&gt;</code></p><p class="index13 number14 alt1 line">&#160;&#160;&#160;&#160;&#160;&#160; &lt;translator name="dummy-loopback" type="loopback"&gt;</p><p class="index13 number14 alt1 line">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name="rowCount" value="0"/&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160; &lt;/translator&gt;&#160;&#160;&#160;&#160;&#160; </p><p style="min-height: 8pt; padding: 0px;">&#160;</p><p>Now you can use the admin assignToModel to replace a loopback - assignToModel(vdb, version, "Customers", "other", "sqlserver", "some jndi"); or to revert back to a dummy source - assignToModel(vdb, version, "Customers", "other", "dummy-loopback", null);</p><p style="min-height: 8pt; padding: 0px;">&#160;</p><p>This of course will only work if you know your source names in advance or at least add enough names to accomodate whatever your usage is.&#160; This is somewhat related to the notion of using the partial results flag but would not result in a lot of unnecessary exceptions.&#160; Of course a built-in solution is still preferred.</p></div></div><!-- [DocumentBodyEnd:e7479727-fa64-49cd-9a09-bd5c471bd3b1] -->2013-06-14T12:27:28Z4 years 9 months ago30Re: How to add/remove source names at runtime in multi-source scenario?preeti1987060/people/preeti1987060do-not-reply@jboss.com2013-06-14T09:35:39Z2013-06-14T09:35:39Z<!-- [DocumentBodyStart:00bf1cee-10e9-451f-a358-d576f8d9dac7] --><div class="jive-rendered-content"><p>Hi,</p><p>Is this possible now with latest Teiid version as we are also looking for this kind of dynamic behaviour .</p><p style="min-height: 8pt; padding: 0px;">&#160;</p><p>Thanks.</p></div><!-- [DocumentBodyEnd:00bf1cee-10e9-451f-a358-d576f8d9dac7] -->2013-06-14T09:35:39Z4 years 9 months ago40Re: How to add/remove source names at runtime in multi-source scenario?Mark Addleman/people/markaddlemando-not-reply@jboss.com2013-06-03T23:03:15Z2013-06-03T23:03:15Z<!-- [DocumentBodyStart:93034bef-85c7-46e9-a21b-2360e7d5ad37] --><div class="jive-rendered-content"><blockquote class="jive-quote"><p>Can someone log an enhancment?</p></blockquote><p>Someone did <span aria-label="Happy" class="emoticon_happy emoticon-inline" style="height:16px;width:16px;"></span><span>&#160; </span><a class="jive-link-external-small" href="https://issues.jboss.org/browse/TEIID-2527" target="_blank">https://issues.jboss.org/browse/TEIID-2527</a></p></div><!-- [DocumentBodyEnd:93034bef-85c7-46e9-a21b-2360e7d5ad37] -->2013-06-03T23:03:15Z4 years 9 months ago50Re: How to add/remove source names at runtime in multi-source scenario?Ramesh Reddy/people/rareddydo-not-reply@jboss.com2013-06-03T22:57:49Z2013-06-03T22:57:49Z<!-- [DocumentBodyStart:450d0c8e-3ae6-4e7d-8d4c-9498f01c1ce1] --><div class="jive-rendered-content"><p>Bobby,</p><p style="min-height: 8pt; padding: 0px;">&#160;</p><p>You are on right track, that is how we do the Designer preview work too. We deploy a VDB for every model, then use another VDB using vdb-import feature to contain all the other child VDBs to make it behave as one. However that still does not work for multi-source scenario as you wanted.</p><p style="min-height: 8pt; padding: 0px;">&#160;</p><p>We need to do something like what Mark is suggesting, which is possible, however all schemas need to be homogenious (there was another feature request to read metadata from each source in multi-source scenario, could not find the JIRA)</p><p><br/>Ramesh..</p></div><!-- [DocumentBodyEnd:450d0c8e-3ae6-4e7d-8d4c-9498f01c1ce1] -->2013-06-03T22:57:49Z4 years 9 months ago0Re: How to add/remove source names at runtime in multi-source scenario?Steven Hawkins/people/shawkinsdo-not-reply@jboss.com2013-06-03T22:56:59Z2013-06-03T22:56:59Z<!-- [DocumentBodyStart:890a6bb8-2243-4e21-8694-62800ca67f6e] --><div class="jive-rendered-content"><p>&gt; Since the schema is already known to Teiid (available at VDB initialization time), it seems like adding new sources would be reasonably straightforward?</p><p style="min-height: 8pt; padding: 0px;">&#160;</p><p>Kind of.&#160; The metadata is known, but there several paths such as the creation of the ConnectorManagers would need to be updated.&#160; For the most part the planning logic is fine, but the metadata would need to be thread-safe and modifications would likely have to trigger plan invalidations.</p><p style="min-height: 8pt; padding: 0px;">&#160;</p><p>&gt; This is useful step toward greater dynamism.</p><p style="min-height: 8pt; padding: 0px;">&#160;</p><p>Can someone log an enhancment?</p></div><!-- [DocumentBodyEnd:890a6bb8-2243-4e21-8694-62800ca67f6e] -->2013-06-03T22:56:59Z4 years 9 months ago60Re: How to add/remove source names at runtime in multi-source scenario?Bobby Diaz/people/bobby.diazdo-not-reply@jboss.com2013-06-03T22:50:06Z2013-06-03T22:50:06Z<!-- [DocumentBodyStart:f9637d1b-46d7-4bf4-a159-a1ad785e1c73] --><div class="jive-rendered-content"><p>Re-deployment is really not an option due to the fact that there may be open connections to the vdb at the time another source comes online.&#160; In my scenario, there could be any number of clients connecting to the vdb to pull data from any number of sources, all with the same schema.</p><p style="min-height: 8pt; padding: 0px;">&#160;</p><p>An alternative I considered was to use a vdb archive as a template and deploy with a different name for each new source that became available, but I could not find a way to set the name of the vdb via the Admin API at time of deployment.&#160; It seems as though the name is taken from the vdb.xml file regardless of the name passed to the Admin.deploy() method.&#160; Is this correct or is there a way to do this?</p></div><!-- [DocumentBodyEnd:f9637d1b-46d7-4bf4-a159-a1ad785e1c73] -->2013-06-03T22:50:06Z4 years 9 months ago10Re: How to add/remove source names at runtime in multi-source scenario?Mark Addleman/people/markaddlemando-not-reply@jboss.com2013-06-03T22:21:03Z2013-06-03T22:21:03Z<!-- [DocumentBodyStart:8d040e2f-0836-455b-823a-f358ccb5ef28] --><div class="jive-rendered-content"><p>I'm just venturing a guess:&#160; Since the schema is already known to Teiid (available at VDB initialization time), it seems like adding new sources would be reasonably straightforward?&#160; This is useful step toward greater dynamism.</p></div><!-- [DocumentBodyEnd:8d040e2f-0836-455b-823a-f358ccb5ef28] -->2013-06-03T22:21:03Z4 years 9 months ago70