Flush Connection Pool
By shalini_m on Dec 16, 2009
Re-initialize connections established in the pool without reconfiguration? – Flush Connection Pool is the solution.
This is a new feature in the latest GlassFish V3 that works to recreate the connections in the jdbc connection pool and brings the pool back to the steady pool size. Administrator's work is simplified by just executing the command (CLI) or pressing the Flush button in the GUI.
- Live connections are killed/destroyed
- Existing transactions are lost & hence should be retired
- Pool brought to steady pool size after flush
max-pool-size set to 5
steady-pool-size set to 5 (5 connections are initialized in the pool when it is created)
We would verify how Flush works based on physical connection IDs
An application that uses the jdbc resource of this connection pool gets 4 connections and closes them everytime in a loop. In this process, the logical connections are closed and returned back to the pool. The physical connection handles  for these 4 connections would be the same.
When a Flush is executed after this, the 5 connections that are in the pool are killed and recreated. When a 5th connection is got from the pool, the physical connection handle would be different.
Flush connection pool can be invoked in multiple ways :
Some of the WARNING messages you might encounter when database server is not up or pool is not initialized and Flush is invoked :