26 #ifndef __TERRALIB_POSTGIS_INTERNAL_CONNECTIONPOOL_H
27 #define __TERRALIB_POSTGIS_INTERNAL_CONNECTIONPOOL_H
30 #include "../dataaccess/datasource/AbstractConnectionPool.h"
40 class ScopedConnection;
169 class ConnectionPoolImpl;
This class defines the basic interface for a connection pool.
This class implements a connection pool for the PostGIS driver.
void idle()
It releases the connections that are not in use for a long time.
void setConnectionInUse(const int &id, const bool &inUse)
Sets the state of the connection by id.
int getAvailableConnectionId()
Gets the first available connection.
bool isValid() const
It checks if all the connections in the pool are valid (the communication channel is ok).
void setInitialPoolSize(std::size_t size)
It sets the initial number of connections opened by the pool at its startup.
void release(Connection *conn)
It brings the informed connection back to the pool.
te::pgis::DataSource * getDataSource() const
std::size_t getInitialPoolSize() const
It returns the initial number of connections opened by the pool at its startup.
unsigned int getMaxIdleTime() const
It returns the maximum idle time in seconds that a connection can be maintained in the pool without b...
ConnectionPoolImpl * m_pImpl
A pointer to the pool implementation.
std::size_t getPoolSize() const
It returns the number of connections in the pool.
void initialize()
It initializes the connections to be managed by the pool.
~ConnectionPool()
Destructor.
bool isInitialized() const
It returns true if the connection pool is initialized, otherwise it returns false.
Connection * getConnection(int id=-1)
It returns a connection from the pool.
te::pgis::Connection * getConnectionById(const int &id)
Gets a connection by id.
std::size_t getMaxPoolSize() const
It returns the maximum number of connections managed by the pool.
std::size_t getMinPoolSize() const
It returns the minimum number of connections managed by the pool.
void setMinPoolSize(std::size_t size)
It sets the minimum number of connections managed by the pool.
void setMaxPoolSize(std::size_t size)
It sets the maximum number of connections managed by the pool.
void finalize()
It closes all connections and clears all resources managed by the pool.
void setMaxIdleTime(unsigned int t)
It sets the maximum idle time that a connection can be maintained in the pool without being used.
ConnectionPool(DataSource *ds)
It creates a new connection pool for the database informed.
A class that implements a connection to a PostgreSQL database.
#define TEPGISEXPORT
You can use this macro in order to export/import classes and functions from this module.
Proxy configuration file for TerraView (see terraview_config.h).