2 Replies Latest reply on Dec 20, 2013 9:25 PM by Marlon Patrick

    Abandoned Connections

    Marlon Patrick Newbie

      Is there a mechanism in JBoss EAP 6.1 which can close automatically connections abandoned if my application is with some "connection leak"?


      I researched a lot and found nothing so far. I saw that in Tomcat there are some parameters to configure this feature on a datasource:


      removeAbandoned = "true"

      removeAbandonedTimeout = "60"

      logAbandoned = "true"

        • 1. Re: Abandoned Connections
          Wolf-Dieter Fink Master

          You need to add two things:

          • the datasource need to have the setting use-ccm=true
          • the jca subsystem cache-connection-manager need to have the debug setting, you can active in standalone mode via CLI with
            /subsystem=jca/cached-connection-manager=cached-connection-manager:write-attribute(name=debug, value=true)

          If you have this enabled you will see a stacktrace and a message that the connection is closed for you.

          But it's recommended to fix the code!

          • 2. Re: Abandoned Connections
            Marlon Patrick Newbie

            Hi Wolf,


            I had seen this solution and I'm even using it, however, do not think that is the ideal. Both Tomcat and Glassfish you can specify a timeout for the server to close the connection.


            In the case of CCM the connection is closed so my business method is finished and this behavior may not be the desired in some situation.