View source | Discuss this page | Page history | Printable version   
Main Page
Upload file
What links here
Recent changes

PDF Books
Add page
Show collection (0 pages)
Collections help


Modules:Tomcat JDBC Connection Pool

Bulbgraph.png   The use of external connection pools is available from 3.0MP32



Openbravo uses connection pools to reuse existing connections/prepared statements, avoiding the cost of initiating a connection, parsing SQL etc. By default Openbravo uses two different connection pools:

From 3.0MP32 it is possible to specify an external connection provider to replace these two connection pools. Openbravo provides a free commercial module that implements the Tomcat JDBC Connection Pool.

Advantages of using JDBC Connection Pool

Adding Interceptors

Adding a custom interceptor is very easy. You just have this into consideration:

package org.openbravo.tomcatjdbcconnectionpool;
import java.lang.reflect.Method;
import javax.enterprise.context.ApplicationScoped;
import org.apache.tomcat.jdbc.pool.ConnectionPool;
import org.apache.tomcat.jdbc.pool.JdbcInterceptor;
import org.apache.tomcat.jdbc.pool.PooledConnection;
import org.openbravo.database.PoolInterceptorProvider;
public class TestInterceptor extends JdbcInterceptor implements PoolInterceptorProvider {
  public void reset(ConnectionPool parent, PooledConnection con) {
    // Actions after a connection has been borrowed from the pool
  // Gets invoked each time an operation on Connection is invoked.
  public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
    // Actions before the method invocation
    Object object = super.invoke(proxy, method, args);
    // Actions before the method invocation
    return object;
  // Return the full name of the interceptor class
  public String getPoolInterceptorsClassName() {
    String fullClassName = this.getClass().getName();
    return fullClassName + ";";

Inclusion in

Openbravo will not start using the external connection pool until the module has been installed and the following line has been added to


Pool Configuration

The Tomcat JDBC Connection Pool can be configured to meet your environment needs. These are some of the parameters that can be configured:

The full list of configurable properties can be found here. This link provides information about about how to configure these properties for high concurrent environments.

To configure the pool properties, the modules/org.openbravo.tomcatjdbcconnectionpool/config/ file has to be copied to modules/org.openbravo.tomcatjdbcconnectionpool/config/, and then the properties of that file must be assigned so that the pool behaves according to the environment needs.

Retrieved from ""

This page has been accessed 1,053 times. This page was last modified on 18 January 2017, at 16:55. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.