Proxool Connection Pool

When you create a PersistenceManagerFactory / EntityManagerFactory you define the connection URL, driver name, and the username/password to use. This works perfectly well but does not "pool" the connections so that they are efficiently opened/closed when needed to utilise datastore resources in an optimum way. DataNucleus allows you to utilise a connection pool using Proxool to efficiently manage the connections to the datastore.

Proxool is a third-party library providing connection pooling. This is accessed by specifying the persistence property datanucleus.connectionPoolingType . To utilise Proxool-based connection pooling we do this

// Specify our persistence properties used for creating our PMF/EMF
Properties props = new Properties();
properties.setProperty("datanucleus.connectionPoolingType", "Proxool");

So the PMF / EMF will use connection pooling using Proxool. To do this you will need the proxool and commons-logging JARs to be in the CLASSPATH.

You can also specify persistence properties to control the actual pooling. The currently supported properties for Proxool are shown below


datanucleus.connectionPool.testSQL=SELECT 1