Subject | Connection Pool ?'s |
---|---|
Author | William L. Thomson Jr. |
Post date | 2002-12-02T00:10:58Z |
I am a little curious about how the connection pool logic works when
using FBWrappingDataSource.
1.) How do you close/destroy the pool when you are done? A method or
something that would close all connections explicitly and politely, or
is it not necessary?
2.) How low can you set the time out without increasing server load
during periods of low traffic? While not leaving connections open longer
than necessary.
3.) How can you be sure a connection was returned. I know I could
compare the max connections to the available one, but if for some reason
the connection was not returned. What can I do to return it explicitly?
I will explain a little more on the second. If I understand the logic
correctly setting the IdleTimeout/IdleTimeoutMinutes controls how long
it takes to close a connection after connection close has been called.
If no requests for a connection is made, the connection will time out
and be closed. The time out will be used to close all connections down
to the minimum setting of the pool.
I believe once I set the IdleTimeout to low and it seemed as soon as
connections were created they were destroyed. This only seemed to happen
over a period that no requests for connections were made. Like over an
hour or so.
Now this was some time back and there may have been a problem in the
driver causing this?
Currently I have it set to 1 minute.
However I seem to be having a problem with connections not being
available. This seems strange since I am 99% sure close connection was
called and succeeded. Yet it seems my connections are not being returned
to the pool.
I have double the amount of available connections and dropped the
timeout down from 5 minutes to 1. After a while I get the following
error.
java.sql.SQLException: Problem getting connection:
org.firebirdsql.jca.FBResourceException: No ManagedConnections
Available!
So why are my connections not timing out? I can wait over 5 minutes,
while using a 1 minute timeout and still nothing.
So I have a feeling my calling connection close is not registering with
the pool or something?
Under heavy loads this does not seem to be a problem. I mean I have two
pools. The larger one that gets a hell of allot more request does not
have available connection problems, at least not as quickly as the
other.
I would assume it to be visa versa. I would expect the larger pool being
used more to run out sooner. Instead the smaller pool being used less
seems to run out of available connections sooner.
I hope this is not to vague. I can provide code if needed, but I am not
doing anything special. Although things are not working the way I would
expect.
Help.
--
Sincerely,
William L. Thomson Jr.
Support Group
Obsidian-Studios Inc.
439 Amber Way
Petaluma, Ca. 94952
Phone 707.766.9509
Fax 707.766.8989
http://www.obsidian-studios.com
using FBWrappingDataSource.
1.) How do you close/destroy the pool when you are done? A method or
something that would close all connections explicitly and politely, or
is it not necessary?
2.) How low can you set the time out without increasing server load
during periods of low traffic? While not leaving connections open longer
than necessary.
3.) How can you be sure a connection was returned. I know I could
compare the max connections to the available one, but if for some reason
the connection was not returned. What can I do to return it explicitly?
I will explain a little more on the second. If I understand the logic
correctly setting the IdleTimeout/IdleTimeoutMinutes controls how long
it takes to close a connection after connection close has been called.
If no requests for a connection is made, the connection will time out
and be closed. The time out will be used to close all connections down
to the minimum setting of the pool.
I believe once I set the IdleTimeout to low and it seemed as soon as
connections were created they were destroyed. This only seemed to happen
over a period that no requests for connections were made. Like over an
hour or so.
Now this was some time back and there may have been a problem in the
driver causing this?
Currently I have it set to 1 minute.
However I seem to be having a problem with connections not being
available. This seems strange since I am 99% sure close connection was
called and succeeded. Yet it seems my connections are not being returned
to the pool.
I have double the amount of available connections and dropped the
timeout down from 5 minutes to 1. After a while I get the following
error.
java.sql.SQLException: Problem getting connection:
org.firebirdsql.jca.FBResourceException: No ManagedConnections
Available!
So why are my connections not timing out? I can wait over 5 minutes,
while using a 1 minute timeout and still nothing.
So I have a feeling my calling connection close is not registering with
the pool or something?
Under heavy loads this does not seem to be a problem. I mean I have two
pools. The larger one that gets a hell of allot more request does not
have available connection problems, at least not as quickly as the
other.
I would assume it to be visa versa. I would expect the larger pool being
used more to run out sooner. Instead the smaller pool being used less
seems to run out of available connections sooner.
I hope this is not to vague. I can provide code if needed, but I am not
doing anything special. Although things are not working the way I would
expect.
Help.
--
Sincerely,
William L. Thomson Jr.
Support Group
Obsidian-Studios Inc.
439 Amber Way
Petaluma, Ca. 94952
Phone 707.766.9509
Fax 707.766.8989
http://www.obsidian-studios.com