Try this, Using the jmx console (http://localhost:8080/jmx-console), go to the jboss.jca:name=XXX,service=ManagedConnectionPool MBean (where XXX is the datasource name). Change the pool sizes and timeout value. Then wait for the timeout and the connections should be closed.
Also, you can set the pool sizes and timeout in the *-ds.xml file:
<datasources> <local-tx-datasource> <jndi-name>someds</jndi-name> ... <min-pool-size>10</min-pool-size> <max-pool-size>100</max-pool-size> <idle-timeout-minutes>15</idle-timeout-minutes> </local-tx-datasource> </datasources>
Thanks for your suggestion. I think your first suggestion can be done from JMX console and your second suggestion is about flushing the connections which are idle.
Here my requirement is that, we need to flush all the connections whether they are idle or in use(should be flushed after the usage).
Can you please suggest me what can we do in this scenario.
Note:-I would like to know how to use JBossManagedConnectionPool.flush().
ramsbuddha, please do not ask the same question in multiple posts. Since Vicky answered your other post, lets continue the discussion there.