2 Replies Latest reply on Dec 11, 2013 8:43 AM by rafaelvanderlei

    Custom validation connections of datasource

    dbaldo

      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.

        • 1. Re: Custom validation connections of datasource
          dbaldo

          Does anyone know how to solve this problem?

          • 2. Re: Custom validation connections of datasource
            rafaelvanderlei

            Hi, Daniel. Old thread, I know, but if you are still having problems with this, have you tried configuring one of these to true: <validate-on-match> (checks connection as connection is requested) or <background-validation> (checks connection from time to time)?

             

            I'm just a user, so I can´t give more details, but I'm using this feature and observed the validation only happens when I set one of those elements to true. In case you choose <background-validation> it may be necessary to also configure <background-validation-millis>.

             

            Note: I'm using JBoss EAP 6.1.0 (not sure if those properties are available in previous AS 7.x versions. You would need to check that)

             

            Hope it helps you or other people having issues with it.