openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris <>
Subject Re: Impossible to get DBCP working with OpenJPA in standalone app
Date Mon, 16 Sep 2013 19:26:55 GMT
Ok, I gave up on using DBCP.  Since my underlying database is Oracle, I 
decided to try their "Universal Connection Pool"

You can find the ucp.jar in $ORACLE_HOME/ucp/lib/ucp.jar or download from:

Here are the persistence.xml settings that worked in standalone (no 
container) mode:

       <property name="openjpa.jdbc.DBDictionary" 
       <property name="openjpa.ConnectionDriverName" 
       <property name="openjpa.ConnectionProperties"
                user=scott, password=tiger, 
URL=jdbc:oracle:thin:@localhost:1521:orcl, maxPoolSize=25"/>

I have not yet tried in managed mode yet.



P.S.  I'd still like to know how to get DBCP to work in a standalone app...

On 9/16/2013 11:45 AM, Chris wrote:
> When I run my app in a container (JBoss6), the DBCP seems to 
> automagically - just work.  However, I also need to enable connection 
> pooling for unit testing, i.e. not container-managed. In this case, 
> and when there are a lot of records, all the connections are used up.
> I tried both documented ways to explicitly configure DBCP:

> Neither of these works, though.  I verified that in standalone mode 
> the DBCP code *is* being called, i.e. it calls 
> org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(), but 
> unlike when deployed in JBoss, the connections seem to "leak", i.e. 
> they're never closed / returned to the pool.
> Any ideas?
> Thanks,
> Chris

View raw message