Flush Connection Pool

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.

Effects


  • Live connections are killed/destroyed

  • Existing transactions are lost & hence should be retired

  • Pool brought to steady pool size after flush

Example

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 [1] 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.

How-Tos

Flush connection pool can be invoked in multiple ways :



Admin Console Flush


Some of the WARNING messages you might encounter when database server is not up or pool is not initialized and Flush is invoked :





References

[1] Obtain physical connection from a Wrapped connection

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

shalini_m

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today