Databases Reference
In-Depth Information
Configuring Connection Pooling with Reauthentication in a JDBC Environment
As we stated in “Connection Pool Model for JDBC,” page 223, the way you con-
figure the maximum and minimum number of connections in a connection
pool, and the initial size of a connection pool is different when you are using
reauthentication. Here's how.
Example A: JDBC Connection Pool Without Reauthentication
This example shows a connection pool that is configured to work with-
out reauthentication. As you can see in Figure 8-5, two users share con-
nections from the connection pool, but the connections are functionally
separated into one group of connections for User A and another group
of connections for User B. When User A requests a connection, the
Connection Pool Manager assigns an available connection associated
with User A. Similarly, if User B requests a connection, the Connection
Pool Manager assigns an available connection associated with User B. If
a connection is unavailable for a particular user, the Connection Pool
Manager creates a new connection for that user, up to a maximum of 10
connections for each user. In this case, the maximum number of con-
nections in the pool is 20 (10 connections for each user).
The Connection Pool Manager implements the minimum pool size and
initial pool size in a similar way. It initially populates five connections
for User A and five connections for User B and ensures that, at a mini-
mum, five connections are maintained in the pool for each user.
Connection Pool
User A
Maximum
Pool Size = 10
Connections
for User A
and User B
Minimum
Pool Size = 5
User B
Initial
Pool Size = 5
Figure 8-5
Configuring a JDBC connection pool without
reauthentication
 
Search WWH ::




Custom Search