JBoss Community

Data Source Configuration in AS 7

new comment by Rico Neubauer View all comments on this document

Example for an Oracle XA-datasource:

 

 

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

 

    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>

    <xa-datasource-property name="URL">jdbc:oracle:thin:@server:1521:dbname</xa-datasource-property>

 

    <!-- HA: Oracle Specific methods to deal with connection problems -->

    <new-connection-sql>call DBMS_APPLICATION_INFO.SET_MODULE('MyApp ${bisas.pid}','MyDB')</new-connection-sql>

 

    <security>

        <user-name>MyUser</user-name>

        <password>MyPassword</password>

    </security>

 

    <!-- pooling parameters -->

    <xa-pool>

        <min-pool-size>5</min-pool-size>

        <max-pool-size>200</max-pool-size>

        <!-- uncomment to enable interleaving <interleaving/> -->

        <is-same-rm-override>false</is-same-rm-override>

        <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->

        <no-tx-separate-pools/>

    </xa-pool>

 

    <!-- timeout and expiry parameters -->

    <validation>

        <validate-on-match>false</validate-on-match>

        <background-validation-minutes>5</background-validation-minutes>

        <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->

        <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->

        <!-- Checks the Oracle error codes and messages for fatal errors -->

        <exception-sorter class-name="org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter"></exception-sorter>

    </validation>

    <!-- TODO why is this not working? It should comply with the schema

    <time-out>

        <blocking-timeout-millis>60000</blocking-timeout-millis>

        <idle-timeout-minutes>15</idle-timeout-minutes>

    </time-out>

    -->

 

    <statement>

        <prepared-statement-cache-size>20</prepared-statement-cache-size>

        <!-- Whether to monitor for unclosed Statements and ResultSets and issue warnings when the user forgets to close them (default nowarn).

         Use nowarn for production and true for testing -->

        <track-statements>nowarn</track-statements>

    </statement>

</xa-datasource>