2 Replies Latest reply on Dec 25, 2017 12:54 AM by andey

    How to flush the data-source connection pool in jBoss?

    mariaprabudass

      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.

      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)

      Posted below the jBoss configuration. Could you please let me how to resolve this.

      Please through light how to flush the data-source connection pool?

      jBoss Version: 7.0.2.Final

      Configuration:-

      <datasource jndi-name="java:jboss/datasources/TASKORMDS" pool-name="MySqlDS" enabled="true" jta="true" use-java-context="true" use-ccm="true">
        
      <connection-url>
        jdbc:mysql://livedb.co.in:3306/task_details
        
      </connection-url>
        
      <driver>
        com.mysql
        
      </driver>
        
      <transaction-isolation>
        TRANSACTION_READ_COMMITTED
        
      </transaction-isolation>
        
      <pool>
        
      <min-pool-size>
        10
        
      </min-pool-size>
        
      <max-pool-size>
        100
        
      </max-pool-size>
        
      <prefill>
        false
        
      </prefill>
        
      <use-strict-min>
        false
        
      </use-strict-min>
        
      <flush-strategy>
        FailingConnectionOnly
        
      </flush-strategy>
        
      </pool>
        
      <security>
        
      <user-name>
        xxxxx
        
      </user-name>
        
      <password>
        xxxxx
        
      </password>
        
      </security>
        
      <validation>
        
      <check-valid-connection-sql>
        select 1
        
      </check-valid-connection-sql>
        
      <validate-on-match>
        true
        
      </validate-on-match>
        
      <background-validation>
        false
        
      </background-validation>
        
      <use-fast-fail>
        false
        
      </use-fast-fail>
        
      </validation>
        
      <timeout>
        
      <blocking-timeout-millis>
        5000
        
      </blocking-timeout-millis>
        
      <idle-timeout-minutes>
        10
        
      </idle-timeout-minutes>
        
      <set-tx-query-timeout/>
        
      </timeout>
        
      <statement>
        
      <prepared-statement-cache-size>
        0
        
      </prepared-statement-cache-size>
        
      </statement>
        
      </datasource>

        • 1. Re: How to flush the data-source connection pool in jBoss?
          ww20171011

          I ran into the same situation in Wildfly 10.1.0 Final. Did you figure out a way to make flushing idle connections working?

          Thanks

          • 2. Re: How to flush the data-source connection pool in jBoss?
            andey

            The following CLI command will flush all idle connections from a datasource pool named "TASKORMDS":

             

            Standalone Mode:

            /subsystem=datasources/data-source=TASKORMDS/:flush-idle-connection-in-pool

             

            Domain mode:

            /host=master/server=server-one/subsystem=datasources/data-source=TASKORMDS/:flush-idle-connection-in-pool

             

            Flushing Invalid Connections

            Standalone Mode:

            /subsystem=datasources/data-source=TASKORMDS/:flush-invalid-connection-in-pool

             

            Domain Mode:

            /host=master/server=server-one/subsystem=datasources/data-source=TASKORMDS/:flush-invalid-connection-in-pool

             

            Graceful Flush

             

            Standalone Mode:

            /subsystem=datasources/data-source=TASKORMDS/:flush-gracefully-connection-in-pool

             

            Domain Mode:

            /host=master/server=server-one/subsystem=datasources/data-source=TASKORMDS/:flush-gracefully-connection-in-pool

             

            Flushing All Connections

            Standalone Mode:

            /subsystem=datasources/data-source=TASKORMDS/:flush-all-connection-in-pool

            Domain Mode

            /host=master/server=server-one/subsystem=datasources/data-source=TASKORMDS/:flush-all-connection-in-pool