org.firebirdsql.pool
Interface ConnectionPoolConfiguration

All Known Implementing Classes:
FBConnectionPoolDataSource

public interface ConnectionPoolConfiguration

This interface describes a configuration for AbstractConnectionPool instances. Motivation for separating pool configuration into interface is quite simple, it allows third-party applications to load configuration from various sources (resource bundle, XML file, etc.).

Author:
Roman Rokytskyy

Method Summary
 int getBlockingTimeout()
          Get time during which ConnectionPoolDataSource.getPooledConnection() can block.
 int getIdleTimeout()
          Get time after which idle connections will be deallocated.
 int getMaxConnections()
          Get maximum number of physical connections that can be simultaneously open.
 int getMinConnections()
          Get minimum number of open JDBC connections that will be created when pool is started.
 int getPingInterval()
          Get time interval after which connection should be pinged.
 java.lang.String getPingStatement()
          Get SQL statement that will be used to ping connection.
 int getRetryInterval()
          Get interval of getting connections retries.
 boolean isPingable()
          Check if this pool supports pingable connections.
 

Method Detail

getMinConnections

public int getMinConnections()
Get minimum number of open JDBC connections that will be created when pool is started.

Returns:
minimum number of open JDBC connections to open at startup.

getMaxConnections

public int getMaxConnections()
Get maximum number of physical connections that can be simultaneously open.

Returns:
maximum number of simultaneously open physical database connections, 0 if no limit exists.

getBlockingTimeout

public int getBlockingTimeout()
Get time during which ConnectionPoolDataSource.getPooledConnection() can block. By default method blocks forever.

Returns:
pool blocking timeout in milliseconds, Integer.MAX_VALUE indicates blocking forever.

getRetryInterval

public int getRetryInterval()
Get interval of getting connections retries. It might happen that pool contains no free connection. In order not to wait until connection is returned into the pool, pool will try to obtain connection again and again with the interval returned by this method. Default value is 1000 (1 sec).

Returns:
retry interval in milliseconds.

getIdleTimeout

public int getIdleTimeout()
Get time after which idle connections will be deallocated.

Returns:
idle timeout in milliseconds, Integer.MAX_VALUE indicates that idle connections are not removed.

isPingable

public boolean isPingable()
Check if this pool supports pingable connections. Pingable connections are used to correctly check if connection is still alive or not.

Returns:
true if this pool supports pingable connections.

getPingStatement

public java.lang.String getPingStatement()
Get SQL statement that will be used to ping connection. Ping SQL statement returns exactly one row without throwing an exception. Ping SQL statement must not influence the outcome of a transaction.

Examples of ping SQL statements:

Returns:
SQL statement that will be used to ping connection.

getPingInterval

public int getPingInterval()
Get time interval after which connection should be pinged.

Returns:
number of milliseconds in the ping interval.


Copyright © 2001 David Jencks and other authors. All rights reserved.