<!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;"> </p><p>I tried adding two <xa-datasource> 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;"> </p><p>below is the -ds.xml for oracle : </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>oraclePool-xa-ds.xml</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><?xml version="1.0" encoding="UTF-8"?></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><!-- ===================================================================== --></p><p><!--                                                                       --></p><p><!--  JBoss Server Configuration                                           --></p><p><!--                                                                       --></p><p><!-- ===================================================================== --></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span><!-- $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> $ --></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><!-- ===================================================================== --></p><p><!-- ATTENTION:  DO NOT FORGET TO SET Pad=true IN transaction-service.xml  --></p><p><!-- ===================================================================== --></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><datasources></p><p>  <xa-datasource></p><p>    <jndi-name>test</jndi-name></p><p>    <!-- uncomment to enable interleaving <interleaving/> --></p><p>    <isSameRM-override-value>false</isSameRM-override-value></p><p>    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class></p><p>    <xa-datasource-property name="URL">jdbc:oracle:thin:@192.128.2.2:1521:weblogic</xa-datasource-property></p><p>    <xa-datasource-property name="User">help</xa-datasource-property></p><p>    <xa-datasource-property name="Password">help</xa-datasource-property></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p> <!--Pooling Paramters --></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>                    <min-pool-size>5</min-pool-size> </p><p>  <max-pool-size>20</max-pool-size> </p><p>  <blocking-timeout-millis>5000</blocking-timeout-millis> </p><p>  <idle-timeout-minutes>15</idle-timeout-minutes> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool --></p><p>    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name--></p><p>    <!-- Checks the Oracle error codes and messages for fatal errors --></p><p>    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name></p><p>    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa --></p><p>    <no-tx-separate-pools/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) --></p><p>      <metadata></p><p>         <type-mapping>Oracle11g</type-mapping></p><p>      </metadata></p><p>  </xa-datasource></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  <mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter" </p><p>         name="jboss.jca:service=OracleXAExceptionFormatter"></p><p>    <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends></p><p>  </mbean></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p></datasources></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>and the other one for sql server 2005 :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>sqlPool-xa-ds.xml</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><?xml version="1.0" encoding="UTF-8"?></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><!-- ===================================================================== --></p><p><!--                                                                       --></p><p><!--  JBoss Server Configuration                                           --></p><p><!--                                                                       --></p><p><!-- ===================================================================== --></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span><!-- $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> $ --></span></p><p>  <!-- ==================================================================== --></p><p>  <!-- ConnectionManager setup for xa Microsoft SQL Server 2005, using      --></p><p>  <!-- Microsoft's JDBC driver.                                             --></p><p><span>  <!-- Thanks to Benjamin Geer  <</span><a class="jive-link-email-small" href="mailto:benjamin.geer@misys.com" target="_blank">benjamin.geer@misys.com</a><span>>                   --></span></p><p>  <!-- Be sure to set the JndiName property to the name you want to look up --></p><p>  <!-- the datasource under and set the location of your database in        --></p><p>  <!-- the xa-datasource-property section.                                  --></p><p>  <!-- Further information about the Microsoft JDBC Driver version 1.1      --></p><p>  <!-- can be found here:                                                   --></p><p><span>  <!-- </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>               --></span></p><p>  <!-- ==================================================================== --></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><datasources></p><p>  <xa-datasource></p><p>    <jndi-name>MSSQLDS</jndi-name></p><p>    <connection-url></p><p>     jdbc:sqlserver://hello-welcome\\MSSQL2008R2;DatabaseName=ramos</p><p>   </connection-url></p><p>    <driver-class></p><p>     com.microsoft.sqlserver.jdbc.SQLServerDriver</p><p>    </driver-class></p><p>    <user-name>help</user-name></p><p>    <password>help</password></p><p>     <!--Pooling Paramters --></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>                    <min-pool-size>5</min-pool-size> </p><p>  <max-pool-size>20</max-pool-size> </p><p>  <blocking-timeout-millis>5000</blocking-timeout-millis> </p><p>  <idle-timeout-minutes>15</idle-timeout-minutes> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        <metadata></p><p>            <type-mapping>MS SQLSERVER2000</type-mapping></p><p>        </metadata></p><p>  </xa-datasource></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p></datasources></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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>