2 Replies Latest reply on Aug 26, 2013 12:09 PM by Jesper Pedersen

    JBoss EAP datasource background-validation

    Darrell Burgan Newbie

      Sorry if this is the wrong forum, but I'm not sure where to ask this. We're using JBoss EAP 6.0.1 as our production application server and MS SQL Server 2008R2 as the database server. Also using the latest MS JDBC driver. I'm trying to get datasource validation working right, and having some trouble.


      We need validation because our SQL Server cluster, when it fails over from one physical machine to another, abandons all existing database connections and expects the application to reconnect. I won't get started as to what I think of that design, but I'll simply say that because of this behavior we must have validation of our connections.


      I do have validation working, but here's the issue. No matter what I do, JBoss is validating the connection every time it serves up a connection from the datasource. Given our volume, this causes a meaningful impact to the database server. What I really want is for JBoss to periodically validate idle connections in the background.


      This happens both in standalone and in domain mode. Here's a snippet from my standalone.xml:


      <datasource jndi-name="java:jboss/datasources/xxx" pool-name="xxx_pool" enabled="true" use-java-context="true" use-ccm="true" jta="false">

















           <check-valid-connection-sql>SELECT 1</check-valid-connection-sql>








      I've tried a great variety of permutations on this configuration, including using the JBoss adapter class to do the validation instead of explicitly saying "SELECT 1", and also omitting the <timeout> and <use-fast-fail> tags, but no behavior change.


      What am I doing wrong?  Help!   :-)



      Darrell Burgan