about the connection pool in j2ee

T

Tiwkiz

In j2ee admin console, Resource -> JDBC -> Connection Pools

In the Pool Settings section, i can define two parameters and description of
each parameters are defined like the following .

Max Wait Time:
Amount of time caller waits before connection timeout is sent

Idle Timeout:
Maximum time that a connection can remain idle in the pool. (default is 300)

and i want to ask about this "Max Wait Time". This is period of time caller
waits until there is a available connection in a pool? Just looking at the
description it's not that clear for me. Can someone clarify this?

Thanks in advance

tw
 
M

Manish Pandit

In j2ee admin console, Resource -> JDBC -> Connection Pools

In the Pool Settings section, i can define two parameters and description of
each parameters are defined like the following .

Max Wait Time:
Amount of time caller waits before connection timeout is sent

Idle Timeout:
Maximum time that a connection can remain idle in the pool. (default is 300)

and i want to ask about this "Max Wait Time". This is period of time caller
waits until there is a available connection in a pool? Just looking at the
description it's not that clear for me. Can someone clarify this?

Thanks in advance

tw

Yes. If a caller requests a connection from the pool, and there is none
available, the pool manager will wait 'n' seconds to see if a
connection becomes available. If there is none available by
'currentTime+n', it will throw an exception indicating a connection
timeout.

Hope this helps!

-cheers,
Manish
 
T

Tristan Austin

Connection pools have an upper limit on how many connections it can contain
at any one time. Connection pools can be configured to allow "shared
connections," meaning that it doesn't matter whether another application or
thread is already using a connection and hasn't yet released it, that same
connection may also be handed out to another app or thread requesting a
connection.

If connections in the pool aren't shared, the maximum number of connections
the pool can contain is reached and all of those connections are currently
allocated to another app or thread, then the next request for a connection
will have to wait until either one of the currently used connections is
released back into the pool or until it reaches the Max Wait Timeout.

So in short, if there are no available connections in the pool and none
become available within the 'Max Wait Time' threshold, the caller will
receive a connection timeout error.

Hope this helps.
Tristan Austin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top