Subject | Re: problem with Connection-Pooling |
---|---|
Author | Roman Rokytskyy |
Post date | 2004-05-28T22:01:25Z |
> Now my custumer gets deadlocks from time to time (every few days),That's exactly the case.
> i have no conclusion, never have seen this with my application
> before.
> I thought blocking should only be necessary, if all connections are
> used.
> But in my getConnection()-method i print outThat's probably bad name for the method and absence documentation.
> dataSource.getConnectionCount() and it says 0.
> This means that 0 connections are used when the error occurs or not.
This method return amount of free connections in the pool. 0 means
that blocking can occur. In order to be sure, you have also to look on
workingSize property (it must be equal to maxSize). However it is not
available in FBWrappingDataSource, only in FBConnectionPoolDataSource.
I will fix this.
> (Another Question is MinConnections only used when getConnection()Correct. See
> is invoked for the first time ?
http://jaybirdwiki.firebirdsql.org/config/FBWrappingDataSourceParameters
Another property suggested by JDBC specs is called initialPoolSize,
but it is currently not supported.
> Or why can getConnectionCount() return values lesser than 5 ?)FBWrappingDataSource.getConnectionCount() ==
FBConnectionPoolDataSource.getFreeSize(). See javadocs for
FBConnectionPoolDataSource.getFreeSize() method.
As a workaround you can replace FBWrappingDataSource with the
following code:
FBConnectionPoolDataSource pool = new FBConnectionPoolDataSource();
.... // set properties, they are the same
DataSource ds = new SimpleDataSource(pool);
FBWrappingDataSource is just a wrapper aroung
FBConnectionPoolDataSource and not all properties of it are visible
through FBWrappingDataSource.
Roman