2 Replies Latest reply on Apr 21, 2015 12:01 PM by Paul Russell

    EAP 6.2 SQL DB pool autoreconnect after db failure

    Paul Russell Newbie

      I have EAP 6.2 installed on Windows 2008. I have configured a SQL server datasource using the sqljdbc4.jar driver. The pool is configured with the Valid Connection Checker set to

      org.jboss.resource.adapter.jdbc.vendor.MSSQLValidConnectionChecker


      Validate on Match set to 'select current_timestamp' and

      Stale Connection CHecker set to

      org.jboss.resource.adapter.jdbc.vendor.MSSQLSta;eConnectionChecker



      If i break the connection to the database with a firewall rule, get a failure with the application, then re-enable traffic the application won't stop getting errors until I manually flush the pool. Also the number of 'active' connections in the pool just continues to climb and it does not appear to drop inactive connections, at least as shown in the console

      !

        • 1. Re: EAP 6.2 SQL DB pool autoreconnect after db failure
          Abhijit Humbe Master

          You have to enable connection validation to help the datasource to recover. The following configuration changes would help you to weed out stale connections from the managed connection pool and to the achieve said goal.

          ------------

          <validate-on-match>true</validate-on-match>

          <valid-connection-checker-class-name> org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLValidConnectionChecker</valid-connection-checker-class-name>

          ------------

           

          - <validate-on-match> - whether to validate the connection when the JCA layer matches a managed connection (i.e. when the connection is checked out of the pool). With the addition of <background-validation> this is not necessarily required. Note: Specifying "true" for <validate-on-match> is typically not done in conjunction with specifying "true" for <background-validation> as this would be overkill in most scenarios. Default is true.

          - <valid-connection-checker-class-name> - a class that can check whether a connection is valid using a vendor specific mechanism.

          Hope it helps..

          • 2. Re: EAP 6.2 SQL DB pool autoreconnect after db failure
            Paul Russell Newbie

            Thanks! I'm not sure if it was the Valid Connection Checker class or the 'Validate on Match' but that has resolved the issue.