4 Replies Latest reply on Jan 14, 2018 4:24 AM by srinu.ydlp

    wildfly-failed to auto release datasource connection to pool

    seetha-s

      As we know in jboss 6 if the code not handled with closing DB connection then the application server will close it and throws a warning message which will occur immediately after the transaction session closed, but this option is not available by default in Wildfly server which we come know after a code with connection left open.By search for solution in this context came to know about flush-strategy needs to be configured to take care of the idle connection, but its strikes the mind,

      1. why this option is removed is not available by default in wildfly server ?
      2. is this part of improvising the performance of server activity for scanning idle connection?

      But because of the default auto release option missing, application code which was not touched for a long time need to be revisited again to manage the connection manually, so it will put a lot of work in front.

      To overcome that, if i provide the flush strategy as "IdleConnections" and idle-timeout-minutes as 0 then will it be the equivalent to immediate connection release configuration and at the same time is this advisable to take this configuration setup to production.

      we tried with below configuration, but the connection left open are not auto closed after the idle time out period 1 minute, so the below configuration also an inappropriate approach for handling idle connection then what would be the exact configuration to accomplish it ?

      <pool>

           <min-pool-size>10</min-pool-size>

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

           <flush-strategy>IdleConnections</flush-strategy>

      </pool>

      <timeout>

           <idle-timeout-minutes>1</idle-timeout-minutes>

      </timeout>

        • 1. Re: wildfly-failed to auto release datasource connection to pool
          ataylor

          I would post this on the Wildfly forums, this has nothing to do with HornetQ.

          • 2. Re: wildfly-failed to auto release datasource connection to pool
            jaysensharma

            In WildFly as well you should be able to see the message "Closing a connection for you. Please close them yourself" generated, If you will enable the jca "cached-connection-manager" debug as following:

             

            /subsystem=jca/cached-connection-manager=cached-connection-manager/:write-attribute(name=debug,value=true)
            

             

            Generated XML Snippet

                    <subsystem xmlns="urn:jboss:domain:jca:2.0">
                        <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
                        <bean-validation enabled="true"/>
                        <default-workmanager>
                              .
                              .
                              .
                        </default-workmanager>
                        <cached-connection-manager debug="true"/>      <!-- #### NOTICE  -->
                    </subsystem>
            


            What it will do ?

               >>> After enabling the above debug you should be able to see the following message in your logs  "Closing a connection for you. Please close them yourself"

               >>>  It will also produce a stacktrace indicating where the leaked connection was opened and it will then Close the leaked connection.

             

            Regards

            Jay SenSharma

            • 3. Re: wildfly-failed to auto release datasource connection to pool
              seetha-s

              we had tried the above configuration but that too not closing the IdleConnections,and we didn't get this message in sever log" Closing a connection for you. Please close them yourself"..

              • 4. Re: wildfly-failed to auto release datasource connection to pool
                srinu.ydlp

                Hi, did you find solution for this. I am also facing same problem.

                Thank you