Subject Re: [Firebird-Java] Re: problem with Connection-Pooling
Author Carsten Schäfer
Roman Rokytskyy wrote:
>> Are you really shure about getConnectionCount() ?
>> When i start my application with minsize = 5 than
>> getConnectionCount() returns 5, with minsize = 4
>> getConnectionCount() returns 4 at the beginning, when not using my
>> application for some time getConnectionCount() decreases, so i
>> thought getConnectionCount() returns the current used connections.
>> (unfortunatly there is no api-doc for getConnectionCount())
>
> I think I am, I wrote that code :). Code of the getConnectionCount():
>
> public int getConnectionCount() {
> return getPool().getFreeSize();
> }
>
> There's javadoc for getFreeSize(). When you start your application,
> number of free connections in the pool is 5. Then if you take one
> connection, it will be 4. It is strange that number of connectios
> decreeses. If you are sure that there's no code "eating" the
> connections, it can also be a bug in pool, when it releases idle
> connections even below minPoolSize margin. I will check it too.
>

Than there is maybe a bug in my code that some connections are not closed.
But I don't understand minsize and maxsize.
I thougt maxsize is the number simultaneous connection i can use.
(When i want to use more than maxsize connection simultaneous i will get the
blocking error)
And minsize is the number of connections that will remain open, even if i
don't use minsize connections, is that right ?
So why is FreeSize = 5 at startup with maxsize = 20 and minsize = 5,
I would say it must be 20, because there are 20 connection i can take
simultanous.

Carsten