Subject problem with Connection-Pooling
Author Carsten Schäfer
(This is a repost of my message, i accidently posted it to the
firebird-support group)

Hi,
Jaybird 1.5RC3, using type4,
I have installed a new version of my program at 1 customer,
the only real thing that changed was that i switched to Jaybird and
ConnectionPooling.
Now my custumer gets deadlocks from time to time (every few days),
i have no conclusion, never have seen this with my application before.
I use a datasource
dataSource = new FBWrappingDataSource();
dataSource.setDatabase(dbRechner+"/"+port+":"+db);
dataSource.setType("type4");
dataSource.setUserName(user);
dataSource.setPassword(passwort);
dataSource.setEncoding("WIN1252");
dataSource.setMinConnections(5);
dataSource.setMaxConnections(20);
dataSource.setPooling(true);
dataSource.setBlockingTimeout(200000);
In one of my logs is that exception directly before the problem occurs:
java.sql.SQLException: Could not obtain connection during blocking timeout
(2000000 ms)
at
org.firebirdsql.pool.PooledConnectionQueue.take(PooledConnectionQueue.java:2
96)
at
org.firebirdsql.pool.AbstractConnectionPool.getPooledConnection(AbstractConn
ectionPool.java:208)
at
org.firebirdsql.pool.FBConnectionPoolDataSource.getPooledConnection(FBConnec
tionPoolDataSource.java:232)
at
org.firebirdsql.pool.FBConnectionPoolDataSource.getPooledConnection(FBConnec
tionPoolDataSource.java:251)
at
org.firebirdsql.pool.FBWrappingDataSource.getConnection(FBWrappingDataSource
.java:127)
at
com.TTC_Informatik.PAULA.server.App_Server.getConnection(App_Server.java:937
8)
at
com.TTC_Informatik.PAULA.server.App_Server.getReadConnection(App_Server.java
> 7540)
at
com.TTC_Informatik.PAULA.server.App_Server.getPGPreis(App_Server.java:1612)

I thought blocking should only be necessary, if all connections are used.
But in my getConnection()-method i print out dataSource.getConnectionCount()
and it says 0.
This means that 0 connections are used when the error occurs or not.
Any Explanations ?
(Another Question is MinConnections only used when getConnection() is
invoked for the first time ?
Or why can getConnectionCount() return values lesser than 5 ?)

mfg
Carsten