2 Replies Latest reply on Feb 3, 2016 2:28 AM by nickarls

    Flushing connection pool?

    nickarls

      I have a situation where an Oracle package can lose it's state somewhere deep down the DB (several packages away from the calling point) and I would like to reset the entire connection pool manually when this occurs. I recall I've done it with a ModelControllerClient in some old project, are there any better ways to do this in WildFly 9+ or do I still have to go through the admin port?

       

      Thanks in advance,

      Nik

        • 1. Re: Flushing connection pool?
          jaysensharma

          Pardon me if i misunderstood your query.  Following are the options which can be used to flush the connections pool manually:

           

          /subsystem=datasources/data-source=ExampleDS/:flush-all-connection-in-pool
          (OR)
          /subsystem=datasources/data-source=ExampleDS/:flush-gracefully-connection-in-pool
          (OR)
          /subsystem=datasources/data-source=ExampleDS/:flush-idle-connection-in-pool
          (OR)
          /subsystem=datasources/data-source=ExampleDS/:flush-invalid-connection-in-pool
          

           

          Regarding your query on " do I still have to go through the admin port?"

          In WildFly if we are using CLI then it is going to use  http-remoting protocol with management port: 9990 (by default) as mentioned in the $WILDFLY_HOME/bin/jboss-cli.xml

           

              <!-- The default controller to connect to when 'connect' command is executed w/o arguments -->
              <default-controller>
                  <protocol>http-remoting</protocol>
                  <host>localhost</host>
                  <port>9990</port>
              </default-controller>
          

           

          Regards

          Jay SenSharma

          • 2. Re: Flushing connection pool?
            nickarls

            Yes, that's about the way I currently do it, I was just wondering about the connection mechanism, is there nowadays some magical helper class that could do

             

            Server.runCommand("any command") and it would connect to the server through direct method calls or do the connect automagically behind the scenes...