1 Reply Latest reply on Nov 25, 2014 1:56 PM by Carlos Lacerda

    Datasource automatic reconnection

    zatopek zatopek Newbie

      hello

      i am several datasources (into my jboss 7) but i have one problem. when my database shutdown the datasource nor reconnect.

      if my database is down and restart into five minutes (for example) how must i configure the datasource for automatic reconnect?

      my datasources definitions is like this:

      <datasource jta="false" jndi-name="java:/DS" pool-name="DSPool" enabled="true" use-java-context="true" use-ccm="true">

                          <connection-url>jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=1531)))(CONNECT_DATA=(SERVICE_NAME=INSTANCE)))</connection-url>

                          <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>

                          <connection-property name="type-mapping">

                              Oracle11g

                          </connection-property>

                          <driver>oracle</driver>

                          <new-connection-sql>select * from dual</new-connection-sql>

                          <pool>

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

                              <max-pool-size>20</max-pool-size>

                          </pool>

                          <security>

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

                              <password>passwd</password>

                          </security>

                          <validation>

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

                              <check-valid-connection-sql>select * from dual</check-valid-connection-sql>

                              <background-validation-millis>5000</background-validation-millis>

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

                          </validation>

                          <timeout>

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

                          </timeout>

                      </datasource>

       

       

       

      Thanks