2 Replies Latest reply on Dec 11, 2013 8:43 AM by Rafael Vanderlei de Souza

    Custom validation connections of datasource

    Daniel Baldo Newbie

      I'm trying to set up custom validation connections of datasource and I'm not getting sucess.

      After research in documentation and several websites I can't found where to set the dependency libraries of this configuration.

      What I would like to do in standalone.xml is:

       

      <datasource jndi-name="java:/OracleDS" pool-name="OracleDS" enabled="true">

        <connection-url>jdbc:oracle:thin:@XX.XX.XX.XX:1521:instance</connection-url>

        <driver>oracle.driver</driver>

        <pool>

          <min-pool-size>2</min-pool-size>

          <max-pool-size>4</max-pool-size>

        </pool>

        <security>

          <user-name>USER</user-name>

          <password>PWD</password>

        </security>

        <statement>

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

          <share-prepared-statements>true</share-prepared-statements>

        </statement>

        <validation>

          <valid-connection-checker class-name="br.com.cia.fwk.server.jboss.OracleValidConnectionChecker">

          </valid-connection-checker>

          <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker">

          </stale-connection-checker>

          <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter">

          </exception-sorter>

        </validation>

        <new-connection-sql>

                  Begin

                  execute immediate('ALTER SESSION SET NLS_SORT=''BINARY''');

                  execute immediate('ALTER SESSION SET NLS_COMP=''BINARY''');

                  end;

        </new-connection-sql>

      </datasource>

       

      Where the Jboss find the class br.com.cia.fwk.server.jboss.OracleValidConnectionChecker??

      Moreover, by which we perceive, jboss is ignoring any configuration tag placed on "valid-connection-checker".

      For example, already added the following settings:

      a) try to define the dependence in the application

      b) try to set an incorrect class <valid-connection-checker class-name="XXXX"> </ valid-connection-checker>

      c) try to open the jar ironjacamar-jdbc-1.0.17.Final-redhat-1.jar and add custom classes inside. The class was not found and no error was displayed in the logs.