How to Use an External Connection Pool

From InfiniteERP Wiki
Jump to: navigation, search
Bulbgraph.png   The use of external connection pools is available from 3.0PR14Q2

Introduction

By default Openbravo uses two connection pools:

  • Hibernate default connection pool for DAL-related queries
  • Apache DBCP for the connections provided by the ConnectionProviderImpl.

From 3.0MP32 it is possible to specify an external connection provider that Openbravo will use to obtain the JDBC connections. For that, a module containing a subclass of ExternalConnectionPool needs to be installed, and the db.externalPoolClassName property has to be set in Openbravo.properties.

Example: Using the Apache JDBC Connection Pool

The Apache JDBC Connection Pool Openbravo modules provides an implementation of the Apache JDBC Connection Pool.

Once the module has been installed, the db.externalPoolClassName property has to be set in Openbravo.properties. This module implements the external connection pool class in the org.openbravo.apachejdbcconnectionpool.JdbcExternalConnectionPool class, so this line should be added to Openbravo.properties:

db.externalPoolClassName=org.openbravo.apachejdbcconnectionpool.JdbcExternalConnectionPool

This module contains a configuration file template: modules/org.openbravo.apachejdbcconnectionpool/config/connectionPool.properties.template. In order to customize the JDBC connection pool properties this file has to be copied to modules/org.openbravo.apachejdbcconnectionpool/config/connectionPool.properties. The user can then configure the pool properties according to his needs. Hints about how to configure this properties can be found here.