1 Reply Latest reply on Dec 6, 2012 1:20 PM by Jesper Pedersen

    Physically closing a set of connections

    Earnest Dyke Novice

      Greetings all,

       

      I am still working on my JCA and I have been presented with a new requirement that I am not sure how to handle.

       

      As it stands now, my JCA can create connections to 1 of 8 physical servers and on any given server the connection can be associated with a given "account". I have this working by implementing a ConnectionRequestInfo class that identifies a host and account. Works great!

       

      Now our ops people want me to provide them with a method of physically closing all of the connections to a given physical server. So I would need access to a list of connections in a pool through which I could loop looking for matching connections based on host name, then physically close each matching connection. I have looked through the spec and the Ironjacamar code and I cannot find any methods that would seem to help.

       

      Anyone have any ideas?

       

      Thanks in advance for any and all relevant responses!

       

      Earnie!

        • 1. Re: Physically closing a set of connections
          Jesper Pedersen Master

          The IronJacamar container controls all the physical connections to the server(s). Atm there is no standard way of having the resource adapter request that all / some of ManagedConnections should be closed - but it is an idea for the specification

           

          The simplest solution would be to deploy 8 CFs, each with their server configuration and use <min-pool-size>0</..><prefill>false</..>, then have the ops people call :flush-all-connection-in-pool for the right CF.

           

          Of course that gives you 8 different JNDI names, so if the above doesn't work for you we will have to think some more, maybe ConnectionEvent.CONNECTION_ERROR_OCCURRED could be an option too; look at that...