<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    How to configure connection pool for two databases??
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/jk.hiren">hiren kesariya</a> in <i>Datasource Configuration</i> - <a href="https://community.jboss.org/message/758931#758931">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>I am trying to make a connection pool for two databases "oracle" and "MS Sql Server 2005".</p><p>Can anybody please help with the -ds.xml file for the same.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I tried adding two &lt;xa-datasource&gt; each for one databse in the same file wothout any success.<br/>i also tried creating two differnet -ds,xml files, but found no success.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>below is the -ds.xml for oracle : </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>oraclePool-xa-ds.xml</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;!-- ===================================================================== --&gt;</p><p>&lt;!--&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt;</p><p>&lt;!--&#160; JBoss Server Configuration&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt;</p><p>&lt;!--&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt;</p><p>&lt;!-- ===================================================================== --&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span>&lt;!-- $Id: oracle-xa-ds.xml 77479 2008-08-26 10:33:09Z </span><a class="jive-link-email-small" href="mailto:alex.loubyansky@jboss.com" target="_blank">alex.loubyansky@jboss.com</a><span> $ --&gt;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;!-- ===================================================================== --&gt;</p><p>&lt;!-- ATTENTION:&#160; DO NOT FORGET TO SET Pad=true IN transaction-service.xml&#160; --&gt;</p><p>&lt;!-- ===================================================================== --&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;datasources&gt;</p><p>&#160; &lt;xa-datasource&gt;</p><p>&#160;&#160;&#160; &lt;jndi-name&gt;test&lt;/jndi-name&gt;</p><p>&#160;&#160;&#160; &lt;!-- uncomment to enable interleaving &lt;interleaving/&gt; --&gt;</p><p>&#160;&#160;&#160; &lt;isSameRM-override-value&gt;false&lt;/isSameRM-override-value&gt;</p><p>&#160;&#160;&#160; &lt;xa-datasource-class&gt;oracle.jdbc.xa.client.OracleXADataSource&lt;/xa-datasource-class&gt;</p><p>&#160;&#160;&#160; &lt;xa-datasource-property name="URL"&gt;jdbc:oracle:thin:@192.128.2.2:1521:weblogic&lt;/xa-datasource-property&gt;</p><p>&#160;&#160;&#160; &lt;xa-datasource-property name="User"&gt;help&lt;/xa-datasource-property&gt;</p><p>&#160;&#160;&#160; &lt;xa-datasource-property name="Password"&gt;help&lt;/xa-datasource-property&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p> &lt;!--Pooling Paramters --&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&lt;min-pool-size&gt;5&lt;/min-pool-size&gt; </p><p>&#160; &lt;max-pool-size&gt;20&lt;/max-pool-size&gt; </p><p>&#160; &lt;blocking-timeout-millis&gt;5000&lt;/blocking-timeout-millis&gt; </p><p>&#160; &lt;idle-timeout-minutes&gt;15&lt;/idle-timeout-minutes&gt; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; &lt;!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool --&gt;</p><p>&#160;&#160;&#160; &lt;!--valid-connection-checker-class-name&gt;org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker&lt;/valid-connection-checker-class-name--&gt;</p><p>&#160;&#160;&#160; &lt;!-- Checks the Oracle error codes and messages for fatal errors --&gt;</p><p>&#160;&#160;&#160; &lt;exception-sorter-class-name&gt;org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter&lt;/exception-sorter-class-name&gt;</p><p>&#160;&#160;&#160; &lt;!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa --&gt;</p><p>&#160;&#160;&#160; &lt;no-tx-separate-pools/&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) --&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;metadata&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;type-mapping&gt;Oracle11g&lt;/type-mapping&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/metadata&gt;</p><p>&#160; &lt;/xa-datasource&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter" </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name="jboss.jca:service=OracleXAExceptionFormatter"&gt;</p><p>&#160;&#160;&#160; &lt;depends optional-attribute-name="TransactionManagerService"&gt;jboss:service=TransactionManager&lt;/depends&gt;</p><p>&#160; &lt;/mbean&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;/datasources&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>and the other one for sql server 2005 :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>sqlPool-xa-ds.xml</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;!-- ===================================================================== --&gt;</p><p>&lt;!--&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt;</p><p>&lt;!--&#160; JBoss Server Configuration&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt;</p><p>&lt;!--&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt;</p><p>&lt;!-- ===================================================================== --&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span>&lt;!-- $Id: mssql-xa-ds.xml 77479 2008-08-26 10:33:09Z </span><a class="jive-link-email-small" href="mailto:alex.loubyansky@jboss.com" target="_blank">alex.loubyansky@jboss.com</a><span> $ --&gt;</span></p><p>&#160; &lt;!-- ==================================================================== --&gt;</p><p>&#160; &lt;!-- ConnectionManager setup for xa Microsoft SQL Server 2005, using&#160;&#160;&#160;&#160;&#160; --&gt;</p><p>&#160; &lt;!-- Microsoft's JDBC driver.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt;</p><p><span>&#160; &lt;!-- Thanks to Benjamin Geer&#160; &lt;</span><a class="jive-link-email-small" href="mailto:benjamin.geer@misys.com" target="_blank">benjamin.geer@misys.com</a><span>&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt;</span></p><p>&#160; &lt;!-- Be sure to set the JndiName property to the name you want to look up --&gt;</p><p>&#160; &lt;!-- the datasource under and set the location of your database in&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt;</p><p>&#160; &lt;!-- the xa-datasource-property section.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt;</p><p>&#160; &lt;!-- Further information about the Microsoft JDBC Driver version 1.1&#160;&#160;&#160;&#160;&#160; --&gt;</p><p>&#160; &lt;!-- can be found here:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt;</p><p><span>&#160; &lt;!-- </span><a class="jive-link-external-small" href="http://msdn2.microsoft.com/en-us/library/aa496082.aspx" target="_blank">http://msdn2.microsoft.com/en-us/library/aa496082.aspx</a><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt;</span></p><p>&#160; &lt;!-- ==================================================================== --&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;datasources&gt;</p><p>&#160; &lt;xa-datasource&gt;</p><p>&#160;&#160;&#160; &lt;jndi-name&gt;MSSQLDS&lt;/jndi-name&gt;</p><p>&#160;&#160;&#160; &lt;connection-url&gt;</p><p>&#160;&#160;&#160;&#160; jdbc:sqlserver://hello-welcome\\MSSQL2008R2;DatabaseName=ramos</p><p>&#160;&#160; &lt;/connection-url&gt;</p><p>&#160;&#160;&#160; &lt;driver-class&gt;</p><p>&#160;&#160;&#160;&#160; com.microsoft.sqlserver.jdbc.SQLServerDriver</p><p>&#160;&#160;&#160; &lt;/driver-class&gt;</p><p>&#160;&#160;&#160; &lt;user-name&gt;help&lt;/user-name&gt;</p><p>&#160;&#160;&#160; &lt;password&gt;help&lt;/password&gt;</p><p>&#160;&#160;&#160;&#160; &lt;!--Pooling Paramters --&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&lt;min-pool-size&gt;5&lt;/min-pool-size&gt; </p><p>&#160; &lt;max-pool-size&gt;20&lt;/max-pool-size&gt; </p><p>&#160; &lt;blocking-timeout-millis&gt;5000&lt;/blocking-timeout-millis&gt; </p><p>&#160; &lt;idle-timeout-minutes&gt;15&lt;/idle-timeout-minutes&gt; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;metadata&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;type-mapping&gt;MS SQLSERVER2000&lt;/type-mapping&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/metadata&gt;</p><p>&#160; &lt;/xa-datasource&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;/datasources&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>NOTE: i am bale to create the oracle pool usng </strong></p><p><strong>oraclePool-xa-ds.xml file alone but as soon as i add the other file </strong></p><p><strong>sqlPool-xa-ds.xml, i get "org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: No XADataSourceClass supplied!)"exception.</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>please help..!!!!!!!</strong></p><p><strong>(please also give some tips to write -ds.xml file for sql server 2005)<br/></strong></p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/758931#758931">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Datasource Configuration at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>