title: How to flush the data-source connection pool in jBoss?
body: <p>I encounter a problem  in production environment where the jBoss data-source connectivity got destroyed suddenly. It is noticed that after the jBoss restart the data-source connectivity became normal. </p>
  
  <p>I guess this might be happened due to connection leakage, i.e unwanted connection exceeds the maximum pool size. This could be resolved by flush the unwanted data-source connection pool.(Correct me if I am wrong)</p>
  
  <p>Posted below the jBoss configuration. Could you please let me how to resolve this.</p>
  
  <p><strong>Please through light how to flush the data-source connection pool?</strong></p>
  
  <p><strong>jBoss Version:</strong> 7.0.2.Final</p>
  
  <p><strong>Configuration:-</strong></p>
  
  <pre><code>&lt;datasource jndi-name="java:jboss/datasources/TASKORMDS" pool-name="MySqlDS" enabled="true" jta="true" use-java-context="true" use-ccm="true"&gt;
                      &lt;connection-url&gt;
                          jdbc:mysql://livedb.co.in:3306/task_details
                      &lt;/connection-url&gt;
                      &lt;driver&gt;
                          com.mysql
                      &lt;/driver&gt;
                      &lt;transaction-isolation&gt;
                          TRANSACTION_READ_COMMITTED
                      &lt;/transaction-isolation&gt;
                      &lt;pool&gt;
                          &lt;min-pool-size&gt;
                              10
                          &lt;/min-pool-size&gt;
                          &lt;max-pool-size&gt;
                              100
                          &lt;/max-pool-size&gt;
                          &lt;prefill&gt;
                              false
                          &lt;/prefill&gt;
                          &lt;use-strict-min&gt;
                              false
                          &lt;/use-strict-min&gt;
                          &lt;flush-strategy&gt;
                              FailingConnectionOnly
                          &lt;/flush-strategy&gt;
                      &lt;/pool&gt;
                      &lt;security&gt;
                          &lt;user-name&gt;
                              xxxxx
                          &lt;/user-name&gt;
                          &lt;password&gt;
                              xxxxx
                          &lt;/password&gt;
                      &lt;/security&gt;
                      &lt;validation&gt;
                          &lt;check-valid-connection-sql&gt;
                              select 1
                          &lt;/check-valid-connection-sql&gt;
                          &lt;validate-on-match&gt;
                              true
                          &lt;/validate-on-match&gt;
                          &lt;background-validation&gt;
                              false
                          &lt;/background-validation&gt;
                          &lt;use-fast-fail&gt;
                              false
                          &lt;/use-fast-fail&gt;
                      &lt;/validation&gt;
                      &lt;timeout&gt;
                          &lt;blocking-timeout-millis&gt;
                              5000
                          &lt;/blocking-timeout-millis&gt;
                          &lt;idle-timeout-minutes&gt;
                              10
                          &lt;/idle-timeout-minutes&gt;
                          &lt;set-tx-query-timeout/&gt;
                      &lt;/timeout&gt;
                      &lt;statement&gt;
                          &lt;prepared-statement-cache-size&gt;
                              0
                          &lt;/prepared-statement-cache-size&gt;
                      &lt;/statement&gt;
                  &lt;/datasource&gt;
  </code></pre>