Author: psteitz
Date: Thu Nov 25 19:50:14 2010
New Revision: 1039158
URL: http://svn.apache.org/viewvc?rev=1039158&view=rev
Log:
Fixed property name inconsistency for connectionInitSqls.
JIRA: DBCP-348
Reported and patched by Eiji Takahashi.
Modified:
commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/changes/changes.xml
commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/java/org/apache/commons/dbcp/BasicDataSourceFactory.java
commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/site/xdoc/configuration.xml
commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/test/org/apache/commons/dbcp/TestBasicDataSourceFactory.java
commons/proper/dbcp/trunk/src/changes/changes.xml
commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSourceFactory.java
commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestBasicDataSourceFactory.java
Modified: commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/changes/changes.xml?rev=1039158&r1=1039157&r2=1039158&view=diff
==============================================================================
--- commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/changes/changes.xml
(original)
+++ commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/changes/changes.xml Thu
Nov 25 19:50:14 2010
@@ -39,6 +39,13 @@ The <action> type attribute can be add,u
</properties>
<body>
<release version="1.4.1" date="TBD" description="TBD">
+ <action dev="psteitz" issue="DBCP-348" due-to="Eiji Takahashi>
+ BasicDataSourceFactory incorrectly used "initConnectSqls" in versions
+ 1.3 and 1.4 of DBCP as the property name for connectionInitSqls.
+ Online docs for 1.3/1/4 have been updated to reflect this
inconsistency.
+ The BasicDataSourceFactory property name has been changed to
"connectInitSqls"
+ to match the online docs and the BasicDataSource property name.
+ </action>
</release>
<release version="1.4" date="2010-02-14" description="This release includes
new features as well as bug fixes and enhancements. Some bug fixes
Modified:
commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/java/org/apache/commons/dbcp/BasicDataSourceFactory.java
URL:
http://svn.apache.org/viewvc/commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/java/org/apache/commons/dbcp/BasicDataSourceFactory.java?rev=1039158&r1=1039157&r2=1039158&view=diff
==============================================================================
---
commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/java/org/apache/commons/dbcp/BasicDataSourceFactory.java
(original)
+++
commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/java/org/apache/commons/dbcp/BasicDataSourceFactory.java
Thu Nov 25 19:50:14 2010
@@ -67,11 +67,11 @@ public class BasicDataSourceFactory impl
private final static String PROP_VALIDATIONQUERY = "validationQuery";
private final static String PROP_VALIDATIONQUERY_TIMEOUT =
"validationQueryTimeout";
/**
- * The property name for initConnectionSqls.
+ * The property name for connectionInitSqls.
* The associated value String must be of the form [query;]*
* @since 1.3
*/
- private final static String PROP_INITCONNECTIONSQLS = "initConnectionSqls";
+ private final static String PROP_CONNECTIONINITSQLS = "connectionInitSqls";
private final static String PROP_ACCESSTOUNDERLYINGCONNECTIONALLOWED =
"accessToUnderlyingConnectionAllowed";
private final static String PROP_REMOVEABANDONED = "removeAbandoned";
private final static String PROP_REMOVEABANDONEDTIMEOUT =
"removeAbandonedTimeout";
@@ -102,7 +102,7 @@ public class BasicDataSourceFactory impl
PROP_USERNAME,
PROP_VALIDATIONQUERY,
PROP_VALIDATIONQUERY_TIMEOUT,
- PROP_INITCONNECTIONSQLS,
+ PROP_CONNECTIONINITSQLS,
PROP_ACCESSTOUNDERLYINGCONNECTIONALLOWED,
PROP_REMOVEABANDONED,
PROP_REMOVEABANDONEDTIMEOUT,
@@ -328,7 +328,7 @@ public class BasicDataSourceFactory impl
dataSource.setMaxOpenPreparedStatements(Integer.parseInt(value));
}
- value = properties.getProperty(PROP_INITCONNECTIONSQLS);
+ value = properties.getProperty(PROP_CONNECTIONINITSQLS);
if (value != null) {
StringTokenizer tokenizer = new StringTokenizer(value, ";");
dataSource.setConnectionInitSqls(Collections.list(tokenizer));
Modified:
commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/site/xdoc/configuration.xml
URL:
http://svn.apache.org/viewvc/commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/site/xdoc/configuration.xml?rev=1039158&r1=1039157&r2=1039158&view=diff
==============================================================================
---
commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/site/xdoc/configuration.xml
(original)
+++
commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/site/xdoc/configuration.xml
Thu Nov 25 19:50:14 2010
@@ -242,7 +242,14 @@ one row.
</td>
</tr>
<tr>
- <td>connectionInitSqls</td>
+ <td>
+ connectionInitSqls <br/>
+ <img src="images/icon_warning_sml.gif"/>
+ <strong>NOTE</strong>: Versions 1.3 and 1.4 of DBCP incorrectly use
"initConnectionSqls"
+ as the name of this property for JNDI object factory configuration.
Until 1.3.1/1.4.1
+ are released, "initConnectionSqls" must be used as the name for this
property when using
+ BasicDataSoureFactory to create BasicDataSource instances via JNDI.
+ </td>
<td>null</td>
<td>
A Collection of SQL statements that will be used to initialize physical
Modified:
commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/test/org/apache/commons/dbcp/TestBasicDataSourceFactory.java
URL:
http://svn.apache.org/viewvc/commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/test/org/apache/commons/dbcp/TestBasicDataSourceFactory.java?rev=1039158&r1=1039157&r2=1039158&view=diff
==============================================================================
---
commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/test/org/apache/commons/dbcp/TestBasicDataSourceFactory.java
(original)
+++
commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/src/test/org/apache/commons/dbcp/TestBasicDataSourceFactory.java
Thu Nov 25 19:50:14 2010
@@ -68,7 +68,7 @@ public class TestBasicDataSourceFactory
properties.setProperty("password", "password");
properties.setProperty("validationQuery", "SELECT DUMMY FROM DUAL");
properties.setProperty("validationQueryTimeout", "100");
- properties.setProperty("initConnectionSqls", "SELECT 1;SELECT 2");
+ properties.setProperty("connectionInitSqls", "SELECT 1;SELECT 2");
properties.setProperty("timeBetweenEvictionRunsMillis", "1000");
properties.setProperty("minEvictableIdleTimeMillis", "2000");
properties.setProperty("numTestsPerEvictionRun", "2");
Modified: commons/proper/dbcp/trunk/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/changes/changes.xml?rev=1039158&r1=1039157&r2=1039158&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/changes/changes.xml (original)
+++ commons/proper/dbcp/trunk/src/changes/changes.xml Thu Nov 25 19:50:14 2010
@@ -39,6 +39,13 @@ The <action> type attribute can be add,u
</properties>
<body>
<release version="1.4.1" date="TBD" description="TBD">
+ <action dev="psteitz" issue="DBCP-348" due-to="Eiji Takahashi>
+ BasicDataSourceFactory incorrectly used "initConnectSqls" in versions
+ 1.3 and 1.4 of DBCP as the property name for connectionInitSqls.
+ Online docs for 1.3/1/4 have been updated to reflect this
inconsistency.
+ The BasicDataSourceFactory property name has been changed to
"connectInitSqls"
+ to match the online docs and the BasicDataSource property name.
+ </action>
</release>
<release version="1.4" date="2010-02-14" description="This release includes
new features as well as bug fixes and enhancements. Some bug fixes
Modified:
commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSourceFactory.java
URL:
http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSourceFactory.java?rev=1039158&r1=1039157&r2=1039158&view=diff
==============================================================================
---
commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSourceFactory.java
(original)
+++
commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSourceFactory.java
Thu Nov 25 19:50:14 2010
@@ -67,11 +67,11 @@ public class BasicDataSourceFactory impl
private final static String PROP_VALIDATIONQUERY = "validationQuery";
private final static String PROP_VALIDATIONQUERY_TIMEOUT =
"validationQueryTimeout";
/**
- * The property name for initConnectionSqls.
+ * The property name for connectionInitSqls.
* The associated value String must be of the form [query;]*
* @since 1.3
*/
- private final static String PROP_INITCONNECTIONSQLS = "initConnectionSqls";
+ private final static String PROP_CONNECTIONINITSQLS = "connectionInitSqls";
private final static String PROP_ACCESSTOUNDERLYINGCONNECTIONALLOWED =
"accessToUnderlyingConnectionAllowed";
private final static String PROP_REMOVEABANDONED = "removeAbandoned";
private final static String PROP_REMOVEABANDONEDTIMEOUT =
"removeAbandonedTimeout";
@@ -102,7 +102,7 @@ public class BasicDataSourceFactory impl
PROP_USERNAME,
PROP_VALIDATIONQUERY,
PROP_VALIDATIONQUERY_TIMEOUT,
- PROP_INITCONNECTIONSQLS,
+ PROP_CONNECTIONINITSQLS,
PROP_ACCESSTOUNDERLYINGCONNECTIONALLOWED,
PROP_REMOVEABANDONED,
PROP_REMOVEABANDONEDTIMEOUT,
@@ -328,7 +328,7 @@ public class BasicDataSourceFactory impl
dataSource.setMaxOpenPreparedStatements(Integer.parseInt(value));
}
- value = properties.getProperty(PROP_INITCONNECTIONSQLS);
+ value = properties.getProperty(PROP_CONNECTIONINITSQLS);
if (value != null) {
StringTokenizer tokenizer = new StringTokenizer(value, ";");
dataSource.setConnectionInitSqls(Collections.list(tokenizer));
Modified:
commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestBasicDataSourceFactory.java
URL:
http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestBasicDataSourceFactory.java?rev=1039158&r1=1039157&r2=1039158&view=diff
==============================================================================
---
commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestBasicDataSourceFactory.java
(original)
+++
commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestBasicDataSourceFactory.java
Thu Nov 25 19:50:14 2010
@@ -68,7 +68,7 @@ public class TestBasicDataSourceFactory
properties.setProperty("password", "password");
properties.setProperty("validationQuery", "SELECT DUMMY FROM DUAL");
properties.setProperty("validationQueryTimeout", "100");
- properties.setProperty("initConnectionSqls", "SELECT 1;SELECT 2");
+ properties.setProperty("connectionInitSqls", "SELECT 1;SELECT 2");
properties.setProperty("timeBetweenEvictionRunsMillis", "1000");
properties.setProperty("minEvictableIdleTimeMillis", "2000");
properties.setProperty("numTestsPerEvictionRun", "2");