openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r989418 - in /openjpa/trunk/openjpa-project/src/doc/manual: ref_guide_integration.xml ref_guide_optimization.xml
Date Thu, 26 Aug 2010 01:18:55 GMT
Author: dwoods
Date: Thu Aug 26 01:18:55 2010
New Revision: 989418

OPENJPA-1731 Doc for using commons-dbcp


Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_integration.xml
--- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_integration.xml (original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_integration.xml Thu Aug 26 01:18:55
@@ -489,4 +489,56 @@ the schema tool:
+    <section id="ref_guide_integration_dbcp">
+        <title>
+            Apache Commons DBCP
+        </title>
+        <indexterm zone="ref_guide_integration_dbcp">
+            <primary>
+                DBCP
+            </primary>
+        </indexterm>
+        <para>
+OpenJPA does not provide its own JDBC connection pooling, as this should already be supplied
to applications running in a Java EE application server in container managed mode.  For Java
SE or applications running in application managed mode, the OpenJPA aggregate openjpa-all
artifact and the binary assembly contains copies of <ulink url="">Apache
Commons DBCP</ulink>, which provides a robust connection pooling implementation.
+        </para>
+        <section id="ref_guide_integration_dbcp_conf">
+            <title>
+                Apache Commons DBCP Configuration Options
+            </title>
+            <indexterm>
+                <primary>
+                    DBCP
+                </primary>
+                <secondary>
+                    configuration options
+                </secondary>
+            </indexterm>
+            <para>
+The <link linkend="ref_guide_dbsetup_thirdparty">JDBC DataSource configuration options</link>
that we will need to modify in order to use Apache Commons DBCP for connection pooling are:
+    connectionDriverName="org.apache.commons.dbcp.BasicDataSource"
+    connectionProperties="DriverClassName=&lt;prior connectionDriverName&gt;, ..."
+Additional Commons DBCP arguments can be provided in the connectionProperties value, such
+    MaxActive=10,MaxIdle=5,MinIdle=2,MaxWait=60000
+Please visit the Commons DBCP website for the entire list of <ulink url="">configuration
options</ulink> and explanations.
+            </para>
+            <example id="ref_guide_integration_dbcp_derby">
+                <title>
+                    Using Commons DBCP with Apache Derby
+                </title>
+For example, to use Commons DBCP with an Apache Derby database server, we would need to provide
the following settings, as either settings in the persistence.xml or as system environment
+&lt;property name="openjpa.ConnectionDriverName" value="org.apache.commons.dbcp.BasicDataSource"/&gt;
+&lt;property name="openjpa.ConnectionProperties" value="DriverClassName=org.apache.derby.jdbc.EmbeddedDriver,
Url=jdbc:derby://localhost:1527/openjpa, Username=uid, Password=pwd"/&gt;
+Notice that we supplied Username and Password settings, which are required by Commons DBCP
for connecting to a database over the network, but can be dummy values if database security
is not enabled.
+            </example>
+        </section>
+    </section>

Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_optimization.xml
--- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_optimization.xml (original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_optimization.xml Thu Aug 26 01:18:55
@@ -61,7 +61,7 @@ more work onto the server will have a ne
                     <entry colname="name">
                         <emphasis role="bold">
-                            Plugin in a Connection Pool
+                            Use a Connection Pool
 <emphasis>performance, scalability</emphasis>
@@ -69,8 +69,8 @@ more work onto the server will have a ne
                     <entry colname="desc">
 OpenJPA's built-in datasource does not perform connection pooling or
-prepared statement caching.  Plugging in a third-party pooling datasource may
-drastically improve performance.
+prepared statement caching.  Plugging in a third-party pooling datasource like <link linkend="ref_guide_integration_dbcp">Apache
Commons DBCP</link>, which is included in the binary distribution and openjpa-all artifact,
+drastically improve application performance.

View raw message