openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dick <>
Subject Re: openjpa, derby, pooled connections?
Date Wed, 19 Aug 2009 14:29:34 GMT

Hi Chris,

OpenJPA does not include a connection pool, so you'll need to plug in a
third party pool like commons-dbcp. 

We use commons-dbcp fairly extensively in our unit tests and it can be
configured similarly to a direct connection to the database. 

For example to use derby add these properties to persistence.xml: 
<property name="openjpa.ConnectionDriverName"
<property name="openjpa.ConnectionProperties"

org.apache.commons.dbcp.BasicDataSource is the datasource, and you specify
the rest of the connection information as ConnectionProperties -
commons-dbcp will handle the rest. 

The configuration for DB2 will be pretty similar but you'll need to include
a username and password. 

Hope this helps,

Christopher Giblin wrote:
> Hi,
> I am developing an Eclipse RCP app with OpenJPA. That is, Java SE, not
> Java
> EE.
> I would like to enable connection pooling and have questions regarding
> Derby and DB2:
> 1) Has anyone a OpenJPA config example for DB2 and connection pooling?
> 2) Is the only way to enable JDBC connection pooling for OpenJPA with a
> Derby database by means of Apache DBCP? Is Derby connection pooling
> possible only through a third-party connection pool?
> Thanks,
> chris

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message