<html>
<head>
    <base href="https://docs.jboss.org/author">
            <link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://docs.jboss.org/author/display/TEIID/Infinispan+Data+Sources">Infinispan Data Sources</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~shawkins">Steven Hawkins</a>
    </h4>
        <br/>
                         <h4>Changes (8)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>The following are the configuration properties that can be configured for this connector: <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">|</span> <span class="diff-added-words"style="background-color: #dfd;">||</span> *Property Name* <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">|</span> <span class="diff-added-words"style="background-color: #dfd;">||</span> *Req.* <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">|</span> <span class="diff-added-words"style="background-color: #dfd;">||</span> *Property Template* <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">|</span> <span class="diff-added-words"style="background-color: #dfd;">||</span> *Description* <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">|</span> <span class="diff-added-words"style="background-color: #dfd;">||</span> <br></td></tr>
            <tr><td class="diff-unchanged" >| CacheTypeMap | Y | cacheName:className\[;pkFieldName\]&amp;nbsp; \\ <br>\[,cacheName:className\[;pkFieldName\]..\] | Map the root Java Object class name to the cache, and identify which attribute is the primary key to the cache. | <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >&amp;nbsp;&amp;nbsp; <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >{color:#333333}There are many ways to create the data source, using <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">CLI,&amp;nbsp;{color}{color:#005e8f}\[AdminShell{color}{color:#333333}\|AdminShell\]{color}{color:#333333},</span> <span class="diff-added-words"style="background-color: #dfd;">CLI,&amp;nbsp;{color}[AdminShell]{color:#333333},</span> admin-console etc. The example shown below uses the CLI tool, as this works in both Standalone and Domain modes.{color} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" >{color:#333333}Execute following command <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">using&amp;nbsp;{color}{color:#005e8f}\[CLI{color}{color:#333333}\|https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-RunningtheCLI\]{color}{color:#333333}&amp;nbsp;once</span> <span class="diff-added-words"style="background-color: #dfd;">using&amp;nbsp;[CLI|https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-RunningtheCLI]{color}{color:#333333}&amp;nbsp;once</span> you connected to the Server. Make sure you provide the correct directory name and other properties below. Add any additional properties required by the connector by duplicating the &quot;connection-definitions&quot; command below. Edit the JNDI name to match the JNDI name you used in VDB.{color} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{code}batch <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">| batch{color:#000000}</span>/subsystem=resource-adapters/resource-adapter=infinispanDS:add(archive=teiid-connector-infinispan.rar,</span> transaction-support=NoTransaction){color} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">/subsystem=resource-adapters/resource-adapter=infinispanDS/connection-definitions=infinispanDS:add(jndi-name=java:/infinispanDS, class-name=org.teiid.resource.adapter.infinispan.InfinispanManagedConnectionFactory, enabled=true, use-java-context=true){color} <br>/subsystem=resource-adapters/resource-adapter=infinispanDS/connection-definitions=infinispanDS/config-properties=CacheTypeMap:add(value=trades:org.somewhere.Trade;tradeId){color} <br>/subsystem=resource-adapters/resource-adapter=infinispanDS/connection-definitions=infinispanDS/config-properties=Module:add(value=org.somewhere)  <br>/subsystem=resource-adapters/resource-adapter=infinispanDS/connection-definitions=infinispanDS/config-properties=CacheJndiName:add(value=java:/myCache)  <br>runbatch  <br>{code} <br></td></tr>
            <tr><td class="diff-unchanged" >\\ <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#000000}/subsystem=resource-adapters/resource-adapter=infinispanDS/connection-definitions=infinispanDS:add(jndi-name=java:/infinispanDS, class-name=org.teiid.resource.adapter.infinispan.InfinispanManagedConnectionFactory, enabled=true, use-java-context=true){color}\\ <br>\\ <br>{color:#000000}/subsystem=resource-adapters/resource-adapter=infinispanDS/connection-definitions=infinispanDS/config-properties=CacheTypeMap:add(value=trades:org.somewhere.Trade;tradeId){color}\\ <br>\\ <br>/subsystem=resource-adapters/resource-adapter=infinispanDS/connection-definitions=infinispanDS/config-properties=Module:add(value=org.somewhere) \\ <br>\\ <br>/subsystem=resource-adapters/resource-adapter=infinispanDS/connection-definitions=infinispanDS/config-properties=CacheJndiName:add(value=java:/myCache) \\ <br>\\ <br>runbatch \\ | <br> <br>\\ <br></td></tr>
            <tr><td class="diff-unchanged" >{info} <br>{color:#333333}To find out all the properties that are supported by this File Connector execute the following command in the CLI.{color} <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{color:#333333}&amp;nbsp;{color} <br>{tip:title=Developer&#39;s Tip} <br></td></tr>
            <tr><td class="diff-changed-lines" >{color:#333333}If the JBoss AS 7.x is running in standalone mode, you can also manually edit the &quot;&lt;jboss-install&gt;/standalone/configuration/standalone-teiid.xml&quot; file and add the XML configuration defined in &quot;&lt;jboss-install&gt;/docs/teiid/datasources/infinispan&quot; directory under &quot;resource-adapters&quot; subsystem. Shutdown the server before you edit this file, and restart after the modifications are <span class="diff-changed-words">done.{color}{tip}<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:black}{*}Labels:*{color}</span></span> <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="InfinispanDataSources-"></a><font color="#000000"><b>Infinispan Data Sources</b></font></h1>

<p><font color="#333333">Infinispan data sources use a Teiid specific JCA connector "teiid-connector-infinispan.rar", which is deployed into the AS7.x during installation. &nbsp;This connector can be configured to support the following modes of Infinispan caches:</font></p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Cache Type </th>
<th class='confluenceTh'> Obtain Cache By </th>
</tr>
<tr>
<td class='confluenceTd'> Local Cache </td>
<td class='confluenceTd'> using JNDI </td>
</tr>
<tr>
<td class='confluenceTd'> Local Cache </td>
<td class='confluenceTd'> using configuration file </td>
</tr>
<tr>
<td class='confluenceTd'> Remote Cache </td>
<td class='confluenceTd'> using JNDI </td>
</tr>
<tr>
<td class='confluenceTd'> Remote Cache </td>
<td class='confluenceTd'> specify 1 or more host:port's </td>
</tr>
<tr>
<td class='confluenceTd'> Remote Cache </td>
<td class='confluenceTd'> specify HotRod client properties file </td>
</tr>
</tbody></table>
</div>


<p>The following are the configuration properties that can be configured for this connector:</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> <b>Property Name</b> </th>
<th class='confluenceTh'> <b>Req.</b> </th>
<th class='confluenceTh'> <b>Property Template</b> </th>
<th class='confluenceTh'> <b>Description</b> </th>
</tr>
<tr>
<td class='confluenceTd'> CacheTypeMap </td>
<td class='confluenceTd'> Y </td>
<td class='confluenceTd'> cacheName:className[;pkFieldName]&nbsp; <br class="atl-forced-newline" />
[,cacheName:className[;pkFieldName]..] </td>
<td class='confluenceTd'> Map the root Java Object class name to the cache, and identify which attribute is the primary key to the cache. </td>
</tr>
<tr>
<td class='confluenceTd'> module </td>
<td class='confluenceTd'> N </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> Specify the JBoss AS module that contains the cache classes that were defined in CacheTypeMap </td>
</tr>
<tr>
<td class='confluenceTd'> CacheJndiName </td>
<td class='confluenceTd'> N </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> JNDI name to fine the CacheContainer </td>
</tr>
<tr>
<td class='confluenceTd'> RemoteServerList </td>
<td class='confluenceTd'> N </td>
<td class='confluenceTd'> host:port[;host:port….] </td>
<td class='confluenceTd'> Specify the host and ports that will be clustered together to access the caches defined in CacheTypeMap </td>
</tr>
<tr>
<td class='confluenceTd'> ConfigurationFileNameForLocalCache </td>
<td class='confluenceTd'> N </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> The Infinispan Configuration xml file for configuring a local cache </td>
</tr>
<tr>
<td class='confluenceTd'> HotRodClientPropertiesFile </td>
<td class='confluenceTd'> N </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> The HotRod properties file for configuring a connection to a remote cache </td>
</tr>
</tbody></table>
</div>

<p>&nbsp;&nbsp;</p>

<p><font color="#333333">There are many ways to create the data source, using CLI,&nbsp;</font><a href="/author/display/TEIID/AdminShell" title="AdminShell">AdminShell</a><font color="#333333">, admin-console etc. The example shown below uses the CLI tool, as this works in both Standalone and Domain modes.</font></p>

<p><font color="#333333">Execute following command using&nbsp;<a href="https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-RunningtheCLI" class="external-link" rel="nofollow">CLI</a></font><font color="#333333">&nbsp;once you connected to the Server. Make sure you provide the correct directory name and other properties below. Add any additional properties required by the connector by duplicating the "connection-definitions" command below. Edit the JNDI name to match the JNDI name you used in VDB.</font></p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">batch
/subsystem=resource-adapters/resource-adapter=infinispanDS:add(archive=teiid-connector-infinispan.rar, transaction-support=NoTransaction){color}
/subsystem=resource-adapters/resource-adapter=infinispanDS/connection-definitions=infinispanDS:add(jndi-name=java:/infinispanDS, class-name=org.teiid.resource.adapter.infinispan.InfinispanManagedConnectionFactory, enabled=true, use-java-context=true){color}
/subsystem=resource-adapters/resource-adapter=infinispanDS/connection-definitions=infinispanDS/config-properties=CacheTypeMap:add(value=trades:org.somewhere.Trade;tradeId){color}
/subsystem=resource-adapters/resource-adapter=infinispanDS/connection-definitions=infinispanDS/config-properties=Module:add(value=org.somewhere) 
/subsystem=resource-adapters/resource-adapter=infinispanDS/connection-definitions=infinispanDS/config-properties=CacheJndiName:add(value=java:/myCache) 
runbatch 
</pre>
</div></div>
<p><br class="atl-forced-newline" /></p>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><font color="#333333">To find out all the properties that are supported by this File Connector execute the following command in the CLI.</font><br/>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">/subsystem=teiid:read-rar-description(rar-name=teiid-connector-infinispan.rar)</pre>
</div></div><font color="#333333">&nbsp;</font></td></tr></table></div>
<p><font color="#333333">&nbsp;</font></p>
<div class='panelMacro'><table class='warningMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><font color="#333333">As of AS 7.1 CR1b release the above does not work without restarting the Server. This issue will be fixed before 7.2 Final.</font></td></tr></table></div>
<p><font color="#333333">&nbsp;</font></p>
<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Developer's Tip</b><br /><font color="#333333">If the JBoss AS 7.x is running in standalone mode, you can also manually edit the "&lt;jboss-install&gt;/standalone/configuration/standalone-teiid.xml" file and add the XML configuration defined in "&lt;jboss-install&gt;/docs/teiid/datasources/infinispan" directory under "resource-adapters" subsystem. Shutdown the server before you edit this file, and restart after the modifications are done.</font></td></tr></table></div>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://docs.jboss.org/author/display/TEIID/Infinispan+Data+Sources">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=55476963&revisedVersion=7&originalVersion=6">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/Infinispan+Data+Sources?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>