Version 7

    Using DataSource with Postgres 7.3

     

    IMPORTANT

    Posgresql requires that you close the connection object in order for the connection to be returned to the connection pool.

    If you do not do this, the connection will not automatically be returned to the pool upon scope exit.

     

    This implies that the scope that acquires the connection will have to ensure that it closes the connection.

     

    Configuration

     

    To use Connection Pooling with Postgres your postgres-ds.xml (see docs/examples/jca) file should reference one of the following JDBC driver classes

     

    JDBC2 -> org.postgresql.jdbc2.optional.PoolingDataSource

     

    JDBC3 -> org.postgresql.jdbc3.Jdbc3PoolingDataSource

     

    See Postgres JDBC Docs for more details

     

    RicardoClements

     

    -


    Note

    In the official JDBC documentation for PostgreSQL (see Connection Pools and Data Sources) an example of a DB connection pool setup for Tomcat is provided, and the only driver class referenced is org.postgresql.Driver

     

    From this, it seems reasonable to assume that connection pooling is done properly (i.e. connections are returned to the pool) when neither org.posgresql.jdbc2.optional.PoolingDataSource nor org.postgresql.jdbc3.Jdbc3PoolingDataSource are used in the postgres-ds.xml file.

     

    CarlosCajina