[openjpa] branch OPENJPA-2754-maxTotal created (now f47170a)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[openjpa] branch OPENJPA-2754-maxTotal created (now f47170a)

solomax-2
This is an automated email from the ASF dual-hosted git repository.

solomax pushed a change to branch OPENJPA-2754-maxTotal
in repository https://gitbox.apache.org/repos/asf/openjpa.git.


      at f47170a  [OPENJPA-2754] maxActive -> maxTotal

This branch includes the following new commits:

     new f47170a  [OPENJPA-2754] maxActive -> maxTotal

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Reply | Threaded
Open this post in threaded view
|

[openjpa] 01/01: [OPENJPA-2754] maxActive -> maxTotal

solomax-2
This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch OPENJPA-2754-maxTotal
in repository https://gitbox.apache.org/repos/asf/openjpa.git

commit f47170a2e4df15f99fef8a45cf995e4ceb77f6b5
Author: Maxim Solodovnik <[hidden email]>
AuthorDate: Wed Oct 24 23:51:25 2018 +0700

    [OPENJPA-2754] maxActive -> maxTotal
---
 openjpa-integration/daytrader/pom.xml                |  4 ++--
 .../openjpa/jdbc/schema/DBCPDriverDataSource.java    |  4 ++--
 .../openjpa/event/TCPRemoteCommitProvider.java       | 18 +++++++++---------
 .../event/TestTCPRemoteEventsDuration.java           |  2 +-
 .../src/test/resources/META-INF/persistence.xml      |  4 ++--
 .../persistence/common/apps/META-INF/persistence.xml |  2 +-
 .../src/test/resources/META-INF/persistence.xml      |  2 +-
 openjpa-project/src/doc/manual/ref_guide_dbsetup.xml |  2 +-
 .../src/doc/manual/ref_guide_integration.xml         |  2 +-
 openjpa-project/src/doc/manual/ref_guide_remote.xml  |  4 ++--
 .../src/test/resources/META-INF/persistence.xml      | 20 ++++++++++----------
 pom.xml                                              |  6 +++---
 12 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/openjpa-integration/daytrader/pom.xml b/openjpa-integration/daytrader/pom.xml
index 7d888a6..14b5b64 100644
--- a/openjpa-integration/daytrader/pom.xml
+++ b/openjpa-integration/daytrader/pom.xml
@@ -39,11 +39,11 @@
         <checkstyle.config.location>${project.basedir}${file.separator}..${file.separator}..${file.separator}openjpa-project${file.separator}checkstyle.xml</checkstyle.config.location>
         <checkstyle.suppressions.location>${project.basedir}${file.separator}..${file.separator}..${file.separator}openjpa-project${file.separator}suppressions.xml</checkstyle.suppressions.location>
         <daytrader.version>2.2-SNAPSHOT</daytrader.version>
-        <dbcp.maxActive>10</dbcp.maxActive>
+        <dbcp.maxTotal>10</dbcp.maxTotal>
         <dbcp.maxIdle>5</dbcp.maxIdle>
         <dbcp.minIdle>2</dbcp.minIdle>
         <dbcp.maxWait>10000</dbcp.maxWait>
-        <dbcp.args>MaxActive=${dbcp.maxActive},MaxIdle=${dbcp.maxIdle},MinIdle=${dbcp.minIdle},MaxWait=${dbcp.maxWait}</dbcp.args>
+        <dbcp.args>MaxTotal=${dbcp.maxTotal},MaxIdle=${dbcp.maxIdle},MinIdle=${dbcp.minIdle},MaxWait=${dbcp.maxWait}</dbcp.args>
     </properties>
 
     <dependencies>
diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DBCPDriverDataSource.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DBCPDriverDataSource.java
index c2d28e4..9c707e8 100644
--- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DBCPDriverDataSource.java
+++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DBCPDriverDataSource.java
@@ -194,8 +194,8 @@ extends SimpleDriverDataSource implements Configurable, Closeable {
         if (hasKey(dbcpProps, "minIdle") == null) {
             dbcpProps.setProperty("minIdle", "0");
         }
-        if (hasKey(dbcpProps, "maxActive") == null) {
-            dbcpProps.setProperty("maxActive", "10");
+        if (hasKey(dbcpProps, "maxTotal") == null) {
+            dbcpProps.setProperty("maxTotal", "10");
         }
 
         return dbcpProps;
diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/event/TCPRemoteCommitProvider.java b/openjpa-kernel/src/main/java/org/apache/openjpa/event/TCPRemoteCommitProvider.java
index 293dcf9..f9144e6 100644
--- a/openjpa-kernel/src/main/java/org/apache/openjpa/event/TCPRemoteCommitProvider.java
+++ b/openjpa-kernel/src/main/java/org/apache/openjpa/event/TCPRemoteCommitProvider.java
@@ -87,7 +87,7 @@ public class TCPRemoteCommitProvider
     private long _id;
     private byte[] _localhost;
     private int _port = DEFAULT_PORT;
-    private int _maxActive = 2;
+    private int _maxTotal = 2;
     private int _maxIdle = 2;
     private int _recoveryTimeMillis = 15000;
     private TCPPortListener _listener;
@@ -145,16 +145,16 @@ public class TCPRemoteCommitProvider
      * The maximum number of sockets that this provider can
      * simetaneously open to each peer in the cluster.
      */
-    public void setMaxActive(int maxActive) {
-        _maxActive = maxActive;
+    public void setMaxTotal(int maxTotal) {
+        _maxTotal = maxTotal;
     }
 
     /**
      * The maximum number of sockets that this provider can
      * simetaneously open to each peer in the cluster.
      */
-    public int getMaxActive() {
-        return _maxActive;
+    public int getMaxTotal() {
+        return _maxTotal;
     }
 
     /**
@@ -317,7 +317,7 @@ public class TCPRemoteCommitProvider
             for (Iterator iter = _addresses.iterator();
                 iter.hasNext();) {
                 curAddress = (HostAddress) iter.next();
-                curAddress.setMaxActive(_maxActive);
+                curAddress.setMaxTotal(_maxTotal);
                 curAddress.setMaxIdle(_maxIdle);
             }
         }
@@ -817,7 +817,7 @@ public class TCPRemoteCommitProvider
                 throw (UnknownHostException) pae.getException();
             }
             GenericObjectPoolConfig<Socket> cfg = new GenericObjectPoolConfig<>();
-            cfg.setMaxTotal(_maxActive);
+            cfg.setMaxTotal(_maxTotal);
             cfg.setBlockWhenExhausted(true);
             cfg.setMaxWaitMillis(-1L);
             // -1 max wait == as long as it takes
@@ -825,8 +825,8 @@ public class TCPRemoteCommitProvider
             _isAvailable = true;
         }
 
-        private void setMaxActive(int maxActive) {
-            _socketPool.setMaxTotal(maxActive);
+        private void setMaxTotal(int maxTotal) {
+            _socketPool.setMaxTotal(maxTotal);
         }
 
         private void setMaxIdle(int maxIdle) {
diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestTCPRemoteEventsDuration.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestTCPRemoteEventsDuration.java
index 5980f1a..3e5daa5 100644
--- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestTCPRemoteEventsDuration.java
+++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestTCPRemoteEventsDuration.java
@@ -69,7 +69,7 @@ public class TestTCPRemoteEventsDuration
         // transactions
         OpenJPAEntityManagerFactory senderFactory1TCP =
             createDistinctFactory(TCPRemoteCommitProvider.class,
-                "MaxActive=4, RecoveryTimeMillis=1000, Port=5636, " +
+                "MaxTotal=4, RecoveryTimeMillis=1000, Port=5636, " +
                     "Addresses=127.0.0.1:5636;127.0.0.1:6636");
         OpenJPAEntityManagerFactory factory2TCP = createDistinctFactory(
             TCPRemoteCommitProvider.class,
diff --git a/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml b/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml
index b37c438..7fd9093 100644
--- a/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml
+++ b/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml
@@ -70,7 +70,7 @@
             <property name="openjpa.ConnectionDriverName"
                 value="org.apache.commons.dbcp.BasicDataSource"/>
             <property name="openjpa.ConnectionProperties"
-                value="DriverClassName=org.apache.derby.jdbc.EmbeddedDriver,Url=jdbc:derby:target/database/openjpa-test-database;create=true,MaxActive=100,MaxWait=10000,TestOnBorrow=true"/>
+                value="DriverClassName=org.apache.derby.jdbc.EmbeddedDriver,Url=jdbc:derby:target/database/openjpa-test-database;create=true,MaxTotal=100,MaxWait=10000,TestOnBorrow=true"/>
             -->
             <property name="openjpa.jdbc.SynchronizeMappings"
                 value="buildSchema(ForeignKeys=true)"/>
@@ -526,7 +526,7 @@
         <class>org.apache.openjpa.persistence.cascade.pudefault.AnEmbeddable</class>
         <class>org.apache.openjpa.persistence.cascade.pudefault.EmbeddableWithRelationships</class>
         <properties>
-            <property name="openjpa.ConnectionFactoryProperties" value="MaxActive=110, MaxIdle=10, ValidationTimeout=50000,
+            <property name="openjpa.ConnectionFactoryProperties" value="MaxTotal=110, MaxIdle=10, ValidationTimeout=50000,
                                                                      MaxCachedStatements=10, ValidationSQL='', MaxWait=10000, TestOnBorrow=true" />
             <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
         </properties>
diff --git a/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/common/apps/META-INF/persistence.xml b/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/common/apps/META-INF/persistence.xml
index 1e0f22f..92d6bdf 100644
--- a/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/common/apps/META-INF/persistence.xml
+++ b/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/common/apps/META-INF/persistence.xml
@@ -37,7 +37,7 @@
  <class>org.apache.openjpa.persistence.common.apps.Address</class>
  <class>org.apache.openjpa.persistence.common.apps.FemaleUser</class>
  <properties>
- <property name="openjpa.ConnectionFactoryProperties" value="MaxActive=110, MaxIdle=10, ValidationTimeout=50000,
+ <property name="openjpa.ConnectionFactoryProperties" value="MaxTotal=110, MaxIdle=10, ValidationTimeout=50000,
                                                                      MaxCachedStatements=10, ValidationSQL='', MaxWait=10000, TestOnBorrow=true" />
  <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
  </properties>
diff --git a/openjpa-persistence-locking/src/test/resources/META-INF/persistence.xml b/openjpa-persistence-locking/src/test/resources/META-INF/persistence.xml
index b382cad..ee97530 100644
--- a/openjpa-persistence-locking/src/test/resources/META-INF/persistence.xml
+++ b/openjpa-persistence-locking/src/test/resources/META-INF/persistence.xml
@@ -28,7 +28,7 @@
             <property name="openjpa.ConnectionDriverName"
                 value="org.apache.commons.dbcp.BasicDataSource"/>
             <property name="openjpa.ConnectionProperties"
-                value="DriverClassName=org.apache.derby.jdbc.EmbeddedDriver,Url=jdbc:derby:target/database/openjpa-test-database;create=true,MaxActive=100,MaxWait=10000,TestOnBorrow=true"/>
+                value="DriverClassName=org.apache.derby.jdbc.EmbeddedDriver,Url=jdbc:derby:target/database/openjpa-test-database;create=true,MaxTotal=100,MaxWait=10000,TestOnBorrow=true"/>
             -->
             <property name="openjpa.jdbc.SynchronizeMappings"
                 value="buildSchema(ForeignKeys=true)"/>
diff --git a/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml b/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml
index 2ef334e..dd35d59 100644
--- a/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml
+++ b/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml
@@ -290,7 +290,7 @@ false.
 Additional Commons DBCP arguments can be provided in
 <literal>openjpa.connectionProperties</literal>, such as:
 <programlisting>
-    MaxActive=10,MaxIdle=5,MinIdle=2,MaxWait=60000
+    MaxTotal=10,MaxIdle=5,MinIdle=2,MaxWait=60000
 </programlisting>
 Please visit the Commons DBCP website for the entire list of
 <ulink url="http://commons.apache.org/dbcp/configuration.html">configuration options</ulink> and explanations.
diff --git a/openjpa-project/src/doc/manual/ref_guide_integration.xml b/openjpa-project/src/doc/manual/ref_guide_integration.xml
index 794eb3e..81de985 100644
--- a/openjpa-project/src/doc/manual/ref_guide_integration.xml
+++ b/openjpa-project/src/doc/manual/ref_guide_integration.xml
@@ -544,7 +544,7 @@ The <link linkend="ref_guide_dbsetup_thirdparty">JDBC DataSource configuration o
 </programlisting>
 Additional Commons DBCP arguments can be provided in the connectionProperties value, such as:
 <programlisting>
-    MaxActive=10,MaxIdle=5,MinIdle=2,MaxWait=60000
+    MaxTotal=10,MaxIdle=5,MinIdle=2,MaxWait=60000
 </programlisting>
 Please visit the Commons DBCP website for the entire list of <ulink url="http://commons.apache.org/dbcp/configuration.html">configuration options</ulink> and explanations.
             </para>
diff --git a/openjpa-project/src/doc/manual/ref_guide_remote.xml b/openjpa-project/src/doc/manual/ref_guide_remote.xml
index 177a015..6b84fbc 100644
--- a/openjpa-project/src/doc/manual/ref_guide_remote.xml
+++ b/openjpa-project/src/doc/manual/ref_guide_remote.xml
@@ -678,7 +678,7 @@ which notifications should be sent. No default value.
 purpose of transmitting events to peers. You should increase this value as the
 number of concurrent transactions increases. The maximum number of concurrent
 transactions is a function of the size of the connection pool. See the
-<literal>MaxActive</literal> property of <literal>
+<literal>MaxTotal</literal> property of <literal>
 openjpa.ConnectionFactoryProperties</literal> in
 <xref linkend="ref_guide_dbsetup_builtin"/>. Setting a value of 0 will
 result in behavior where the thread invoking <methodname>commit</methodname>
@@ -700,7 +700,7 @@ to each peer in the cluster for the transmission of events. Defaults to 2.
                     </listitem>
                     <listitem>
                         <para>
-<literal>MaxActive</literal>: The maximum allowed number of TCP sockets
+<literal>MaxTotal</literal>: Total allowed number of TCP sockets
 (channels) to open simultaneously between each peer in the cluster. Defaults to
 2.
                         </para>
diff --git a/openjpa-slice/src/test/resources/META-INF/persistence.xml b/openjpa-slice/src/test/resources/META-INF/persistence.xml
index 83a6578..543b6bd 100644
--- a/openjpa-slice/src/test/resources/META-INF/persistence.xml
+++ b/openjpa-slice/src/test/resources/META-INF/persistence.xml
@@ -288,10 +288,10 @@
 
          <property name="openjpa.ConnectionUserName"        value="root"/>
          <property name="openjpa.ConnectionPassword"        value=""/>
-         <property name="openjpa.slice.S1.ConnectionProperties" value="DriverClassName=com.mysql.jdbc.Driver,Url=jdbc:mysql://localhost/S1,MaxActive=4"/>
-         <property name="openjpa.slice.S2.ConnectionProperties" value="DriverClassName=com.mysql.jdbc.Driver,Url=jdbc:mysql://localhost/S2,MaxActive=4"/>
-         <property name="openjpa.slice.S3.ConnectionProperties" value="DriverClassName=com.mysql.jdbc.Driver,Url=jdbc:mysql://localhost/S3,MaxActive=4"/>
-         <property name="openjpa.slice.S4.ConnectionProperties" value="DriverClassName=com.mysql.jdbc.Driver,Url=jdbc:mysql://localhost/S4,MaxActive=4"/>
+         <property name="openjpa.slice.S1.ConnectionProperties" value="DriverClassName=com.mysql.jdbc.Driver,Url=jdbc:mysql://localhost/S1,MaxTotal=4"/>
+         <property name="openjpa.slice.S2.ConnectionProperties" value="DriverClassName=com.mysql.jdbc.Driver,Url=jdbc:mysql://localhost/S2,MaxTotal=4"/>
+         <property name="openjpa.slice.S3.ConnectionProperties" value="DriverClassName=com.mysql.jdbc.Driver,Url=jdbc:mysql://localhost/S3,MaxTotal=4"/>
+         <property name="openjpa.slice.S4.ConnectionProperties" value="DriverClassName=com.mysql.jdbc.Driver,Url=jdbc:mysql://localhost/S4,MaxTotal=4"/>
 
          <property name="openjpa.jdbc.DBDictionary"        value="mysql"/>
          <property name="openjpa.Multithreaded" value="false"/>
@@ -311,7 +311,7 @@
 
          <property name="openjpa.ConnectionUserName"        value="root"/>
          <property name="openjpa.ConnectionPassword"        value=""/>
-         <property name="openjpa.ConnectionProperties" value="DriverClassName=com.mysql.jdbc.Driver,Url=jdbc:mysql://localhost/S,MaxActive=4"/>
+         <property name="openjpa.ConnectionProperties" value="DriverClassName=com.mysql.jdbc.Driver,Url=jdbc:mysql://localhost/S,MaxTotal=4"/>
 
          <property name="openjpa.jdbc.DBDictionary"        value="mysql"/>
          <property name="openjpa.Multithreaded" value="false"/>
@@ -335,10 +335,10 @@
 
          <property name="openjpa.ConnectionUserName"        value="root"/>
          <property name="openjpa.ConnectionPassword"        value=""/>
-         <property name="openjpa.slice.S1.ConnectionProperties" value="DriverClassName=org.mariadb.jdbc.Driver,Url=jdbc:mysql://localhost/S1,MaxActive=4"/>
-         <property name="openjpa.slice.S2.ConnectionProperties" value="DriverClassName=org.mariadb.jdbc.Driver,Url=jdbc:mysql://localhost/S2,MaxActive=4"/>
-         <property name="openjpa.slice.S3.ConnectionProperties" value="DriverClassName=org.mariadb.jdbc.Driver,Url=jdbc:mysql://localhost/S3,MaxActive=4"/>
-         <property name="openjpa.slice.S4.ConnectionProperties" value="DriverClassName=org.mariadb.jdbc.Driver,Url=jdbc:mysql://localhost/S4,MaxActive=4"/>
+         <property name="openjpa.slice.S1.ConnectionProperties" value="DriverClassName=org.mariadb.jdbc.Driver,Url=jdbc:mysql://localhost/S1,MaxTotal=4"/>
+         <property name="openjpa.slice.S2.ConnectionProperties" value="DriverClassName=org.mariadb.jdbc.Driver,Url=jdbc:mysql://localhost/S2,MaxTotal=4"/>
+         <property name="openjpa.slice.S3.ConnectionProperties" value="DriverClassName=org.mariadb.jdbc.Driver,Url=jdbc:mysql://localhost/S3,MaxTotal=4"/>
+         <property name="openjpa.slice.S4.ConnectionProperties" value="DriverClassName=org.mariadb.jdbc.Driver,Url=jdbc:mysql://localhost/S4,MaxTotal=4"/>
 
          <property name="openjpa.jdbc.DBDictionary"        value="mariadb"/>
          <property name="openjpa.Multithreaded" value="false"/>
@@ -358,7 +358,7 @@
 
          <property name="openjpa.ConnectionUserName"        value="root"/>
          <property name="openjpa.ConnectionPassword"        value=""/>
-         <property name="openjpa.ConnectionProperties" value="DriverClassName=org.mariadb.jdbc.Driver,Url=jdbc:mysql://localhost/S,MaxActive=4"/>
+         <property name="openjpa.ConnectionProperties" value="DriverClassName=org.mariadb.jdbc.Driver,Url=jdbc:mysql://localhost/S,MaxTotal=4"/>
 
          <property name="openjpa.jdbc.DBDictionary"        value="mariadb"/>
          <property name="openjpa.Multithreaded" value="false"/>
diff --git a/pom.xml b/pom.xml
index 79916d7..1a7fdb2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -57,11 +57,11 @@
         <!-- Setting for openjpa.DynamicEnhancementAgent usage -->
         <openjpa.DynamicEnhancementAgent>false</openjpa.DynamicEnhancementAgent>
         <!-- Commons DBCP settings passed in as openjpa.ConnectionProperties -->
-        <dbcp.maxActive>10</dbcp.maxActive>
+        <dbcp.maxTotal>10</dbcp.maxTotal>
         <dbcp.maxIdle>5</dbcp.maxIdle>
         <dbcp.minIdle>2</dbcp.minIdle>
         <dbcp.maxWait>10000</dbcp.maxWait>
-        <dbcp.args>MaxActive=${dbcp.maxActive},MaxIdle=${dbcp.maxIdle},MinIdle=${dbcp.minIdle},MaxWait=${dbcp.maxWait}</dbcp.args>
+        <dbcp.args>MaxTotal=${dbcp.maxTotal},MaxIdle=${dbcp.maxIdle},MinIdle=${dbcp.minIdle},MaxWait=${dbcp.maxWait}</dbcp.args>
         <derby.locks.waitTimeout>10</derby.locks.waitTimeout>
         <derby.locks.deadlockTimeout>5</derby.locks.deadlockTimeout>
         <!-- Testcase @AllowFailure options:  ignore = silently skip test,
@@ -668,7 +668,7 @@
                 <!-- DBCP overrides -->
                 <dbcp.maxIdle>0</dbcp.maxIdle>
                 <dbcp.minIdle>0</dbcp.minIdle>
-                <dbcp.maxActive>20</dbcp.maxActive>
+                <dbcp.maxTotal>20</dbcp.maxTotal>
             </properties>
         </profile>