You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ps...@apache.org on 2006/07/31 06:46:47 UTC
svn commit: r427015 - in /jakarta/commons/proper/dbcp/trunk:
src/java/org/apache/commons/dbcp/
src/java/org/apache/commons/dbcp/cpdsadapter/
src/java/org/apache/commons/dbcp/datasources/ xdocs/
Author: psteitz
Date: Sun Jul 30 21:46:46 2006
New Revision: 427015
URL: http://svn.apache.org/viewvc?rev=427015&view=rev
Log:
Fixed errors in pool parameter documentation and made
0 value for _maxPreparedStatements in DriverAdapterCPDS behave
like a negative value, to be consistent with documentation
and pool behavior.
Jira: DBCP-41
Patch due to: Anton Tagunov
Modified:
jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java
jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/DriverAdapterCPDS.java
jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java
jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/SharedPoolDataSource.java
jakarta/commons/proper/dbcp/trunk/xdocs/changes.xml
jakarta/commons/proper/dbcp/trunk/xdocs/configuration.xml
Modified: jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java?rev=427015&r1=427014&r2=427015&view=diff
==============================================================================
--- jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java (original)
+++ jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java Sun Jul 30 21:46:46 2006
@@ -133,7 +133,7 @@
/**
* The maximum number of active connections that can be allocated from
- * this pool at the same time, or zero for no limit.
+ * this pool at the same time, or non-positive for no limit.
*/
protected int maxActive = GenericObjectPool.DEFAULT_MAX_ACTIVE;
@@ -151,7 +151,7 @@
/**
* The maximum number of active connections that can remain idle in the
- * pool, without extra ones being released, or zero for no limit.
+ * pool, without extra ones being released, or negative for no limit.
*/
protected int maxIdle = GenericObjectPool.DEFAULT_MAX_IDLE;;
@@ -241,7 +241,7 @@
/**
* The maximum number of open statements that can be allocated from
- * the statement pool at the same time, or zero for no limit. Since
+ * the statement pool at the same time, or non-positive for no limit. Since
* a connection usually only uses one or two statements at a time, this is
* mostly used to help detect resource leaks.
*/
Modified: jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/DriverAdapterCPDS.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/DriverAdapterCPDS.java?rev=427015&r1=427014&r2=427015&view=diff
==============================================================================
--- jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/DriverAdapterCPDS.java (original)
+++ jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/DriverAdapterCPDS.java Sun Jul 30 21:46:46 2006
@@ -148,7 +148,7 @@
*/
KeyedObjectPool stmtPool = null;
if (isPoolPreparedStatements()) {
- if (getMaxPreparedStatements() == -1)
+ if (getMaxPreparedStatements() <= 0)
{
// since there is no limit, create a prepared statement pool with an eviction thread
// evictor settings are the same as the connection pool settings.
@@ -465,7 +465,7 @@
/**
* The maximum number of active statements that can be allocated from
- * this pool at the same time, or zero for no limit.
+ * this pool at the same time, or non-positive for no limit.
*/
public int getMaxActive() {
return (this.maxActive);
@@ -473,7 +473,7 @@
/**
* The maximum number of active statements that can be allocated from
- * this pool at the same time, or zero for no limit.
+ * this pool at the same time, or non-positive for no limit.
*/
public void setMaxActive(int maxActive) {
assertInitializationAllowed();
@@ -482,7 +482,7 @@
/**
* The maximum number of statements that can remain idle in the
- * pool, without extra ones being released, or zero for no limit.
+ * pool, without extra ones being released, or negative for no limit.
*/
public int getMaxIdle() {
return (this.maxIdle);
@@ -490,7 +490,7 @@
/**
* The maximum number of statements that can remain idle in the
- * pool, without extra ones being released, or zero for no limit.
+ * pool, without extra ones being released, or negative for no limit.
*/
public void setMaxIdle(int maxIdle) {
assertInitializationAllowed();
Modified: jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java?rev=427015&r1=427014&r2=427015&view=diff
==============================================================================
--- jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java (original)
+++ jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java Sun Jul 30 21:46:46 2006
@@ -97,9 +97,9 @@
/**
* The maximum number of active connections that can be allocated from
- * this pool at the same time, or zero for no limit.
+ * this pool at the same time, or non-positive for no limit.
* This value is used for any username which is not specified
- * in perUserMaxConnections. The default is 0.
+ * in perUserMaxConnections.
*/
public int getDefaultMaxActive() {
return (this.defaultMaxActive);
@@ -107,9 +107,9 @@
/**
* The maximum number of active connections that can be allocated from
- * this pool at the same time, or zero for no limit.
+ * this pool at the same time, or non-positive for no limit.
* This value is used for any username which is not specified
- * in perUserMaxConnections. The default is 0.
+ * in perUserMaxConnections. The default is 8.
*/
public void setDefaultMaxActive(int maxActive) {
assertInitializationAllowed();
@@ -118,9 +118,9 @@
/**
* The maximum number of active connections that can remain idle in the
- * pool, without extra ones being released, or zero for no limit.
+ * pool, without extra ones being released, or negative for no limit.
* This value is used for any username which is not specified
- * in perUserMaxIdle. The default is 0.
+ * in perUserMaxIdle.
*/
public int getDefaultMaxIdle() {
return (this.defaultMaxIdle);
@@ -128,9 +128,9 @@
/**
* The maximum number of active connections that can remain idle in the
- * pool, without extra ones being released, or zero for no limit.
+ * pool, without extra ones being released, or negative for no limit.
* This value is used for any username which is not specified
- * in perUserMaxIdle. The default is 0.
+ * in perUserMaxIdle. The default is 8.
*/
public void setDefaultMaxIdle(int defaultMaxIdle) {
assertInitializationAllowed();
@@ -213,7 +213,7 @@
/**
* The maximum number of active connections that can be allocated from
- * this pool at the same time, or zero for no limit.
+ * this pool at the same time, or non-positive for no limit.
* The keys are usernames and the value is the maximum connections. Any
* username specified here will override the value of defaultMaxActive.
*/
@@ -227,7 +227,7 @@
/**
* The maximum number of active connections that can be allocated from
- * this pool at the same time, or zero for no limit.
+ * this pool at the same time, or non-positive for no limit.
* The keys are usernames and the value is the maximum connections. Any
* username specified here will override the value of defaultMaxActive.
*/
@@ -242,7 +242,7 @@
/**
* The maximum number of active connections that can remain idle in the
- * pool, without extra ones being released, or zero for no limit.
+ * pool, without extra ones being released, or negative for no limit.
* The keys are usernames and the value is the maximum connections. Any
* username specified here will override the value of defaultMaxIdle.
*/
@@ -256,7 +256,7 @@
/**
* The maximum number of active connections that can remain idle in the
- * pool, without extra ones being released, or zero for no limit.
+ * pool, without extra ones being released, or negative for no limit.
* The keys are usernames and the value is the maximum connections. Any
* username specified here will override the value of defaultMaxIdle.
*/
Modified: jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/SharedPoolDataSource.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/SharedPoolDataSource.java?rev=427015&r1=427014&r2=427015&view=diff
==============================================================================
--- jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/SharedPoolDataSource.java (original)
+++ jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/SharedPoolDataSource.java Sun Jul 30 21:46:46 2006
@@ -74,8 +74,7 @@
/**
* The maximum number of active connections that can be allocated from
- * this pool at the same time, or zero for no limit.
- * The default is 0.
+ * this pool at the same time, or non-positive for no limit.
*/
public int getMaxActive() {
return (this.maxActive);
@@ -83,8 +82,8 @@
/**
* The maximum number of active connections that can be allocated from
- * this pool at the same time, or zero for no limit.
- * The default is 0.
+ * this pool at the same time, or non-positive for no limit.
+ * The default is 8.
*/
public void setMaxActive(int maxActive) {
assertInitializationAllowed();
@@ -93,8 +92,7 @@
/**
* The maximum number of active connections that can remain idle in the
- * pool, without extra ones being released, or zero for no limit.
- * The default is 0.
+ * pool, without extra ones being released, or negative for no limit.
*/
public int getMaxIdle() {
return (this.maxIdle);
@@ -102,8 +100,8 @@
/**
* The maximum number of active connections that can remain idle in the
- * pool, without extra ones being released, or zero for no limit.
- * The default is 0.
+ * pool, without extra ones being released, or negative for no limit.
+ * The default is 8.
*/
public void setMaxIdle(int maxIdle) {
assertInitializationAllowed();
Modified: jakarta/commons/proper/dbcp/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbcp/trunk/xdocs/changes.xml?rev=427015&r1=427014&r2=427015&view=diff
==============================================================================
--- jakarta/commons/proper/dbcp/trunk/xdocs/changes.xml (original)
+++ jakarta/commons/proper/dbcp/trunk/xdocs/changes.xml Sun Jul 30 21:46:46 2006
@@ -124,6 +124,12 @@
Added connection info to SQLException messages when closed connections
(resp stmts) are accessed in DelegatingConnection, DelegatingStatement.
</action>
+ <action dev="psteitz" type="fix" issue="DBCP-41" due-to="Anton Tagunov">
+ Fixed errors in pool parameter documentation and made
+ 0 value for _maxPreparedStatements in DriverAdapterCPDS behave
+ like a negative value, to be consistent with documentation
+ and pool behavior.
+ </action>
</release>
<release version="1.2.1" date="2004-06-12" description="Maintenance Release to restore JDK 1.3 compatibility">
Modified: jakarta/commons/proper/dbcp/trunk/xdocs/configuration.xml
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbcp/trunk/xdocs/configuration.xml?rev=427015&r1=427014&r2=427015&view=diff
==============================================================================
--- jakarta/commons/proper/dbcp/trunk/xdocs/configuration.xml (original)
+++ jakarta/commons/proper/dbcp/trunk/xdocs/configuration.xml Sun Jul 30 21:46:46 2006
@@ -130,7 +130,7 @@
<td>8</td>
<td>
The maximum number of active connections that can be allocated from
- this pool at the same time, or negative for no limit.
+ this pool at the same time, or non-positive for no limit.
</td>
</tr>
<tr>
@@ -138,7 +138,7 @@
<td>8</td>
<td>
The maximum number of active connections that can remain idle in the
- pool, without extra ones being released, or zero for no limit.
+ pool, without extra ones being released, or negative for no limit.
</td>
</tr>
<tr>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org