You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@excalibur.apache.org by le...@apache.org on 2006/01/25 03:51:32 UTC

svn commit: r372081 - /excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/ResourceLimitingJdbcDataSource.java

Author: leif
Date: Tue Jan 24 18:51:30 2006
New Revision: 372081

URL: http://svn.apache.org/viewcvs?rev=372081&view=rev
Log:
Scratch that last commit.  The auto-commit value should be an element.  This is what the older JdbcDataSource class does.  Functionality will be unchanged, and the javadocs have been corrected.

Modified:
    excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/ResourceLimitingJdbcDataSource.java

Modified: excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/ResourceLimitingJdbcDataSource.java
URL: http://svn.apache.org/viewcvs/excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/ResourceLimitingJdbcDataSource.java?rev=372081&r1=372080&r2=372081&view=diff
==============================================================================
--- excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/ResourceLimitingJdbcDataSource.java (original)
+++ excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/ResourceLimitingJdbcDataSource.java Tue Jan 24 18:51:30 2006
@@ -51,10 +51,11 @@
  *   <rl-jdbc>
  *     &lt;pool-controller max="<i>10</i>" max-strict="<i>true</i>"
  *       blocking="<i>true</i>" timeout="<i>-1</i>"
- *       trim-interval="<i>60000</i>" auto-commit="true"
+ *       trim-interval="<i>60000</i>"
  *       connection-class="<i>my.overrided.ConnectionClass</i>"&gt;
  *       &lt;keep-alive disable="false" age="5000"&gt;select 1&lt;/keep-alive&gt;
  *     &lt;/pool-controller&gt;
+ *     &lt;auto-commit&gt;<i>true</i>&lt;/auto-commit&gt;
  *     &lt;driver&gt;<i>com.database.jdbc.JdbcDriver</i>&lt;/driver&gt;
  *     &lt;dburl&gt;<i>jdbc:driver://host/mydb</i>&lt;/dburl&gt;
  *     &lt;user&gt;<i>username</i>&lt;/user&gt;
@@ -107,10 +108,6 @@
  * org.apache.avalon.excalibur.pool.ResourceLimitingPool#trim()}
  * (Defaults to "60000", 1 minute)</li>
  *
- * <li>The <code>auto-commit</code> attribute is used to determine the
- * default auto-commit mode for the <code>Connection</code>s returned
- * by this <code>DataSource</code>.
- *
  * <li>The <code>connection-class</code> attribute is used to override
  * the Connection class returned by the DataSource from calls to
  * getConnection().  Set this to
@@ -128,6 +125,10 @@
  * this feature.  Setting the <code>age</code> allows the 5 second age to
  * be overridden.  (Defaults to a query of "SELECT 1" and being enabled)</li>
  *
+ * <li>The <code>auto-commit</code> element is used to determine the
+ * default auto-commit mode for the <code>Connection</code>s returned
+ * by this <code>DataSource</code>.
+ *
  * <li>The <code>driver</code> element is used to specify the driver
  * to use when connecting to the database.  The specified class must
  * be in the classpath.  (Required)</li>
@@ -256,16 +257,7 @@
         final long trimInterval = controller.getAttributeAsLong( "trim-interval", 60000 );
         final boolean trace = controller.getAttributeAsBoolean( "trace", false );
         final boolean oradb = controller.getAttributeAsBoolean( "oradb", false );
-
-        // The auto-commit setting is supposed to be defined as an attribute to the
-        //  pool-controller.  There was a bug for a while where it was being looked for
-        //  as a child element of the pool.  To avoid breaking things for users configured
-        //  for use with the buggy version, default to looking for the child element as well.
-        final boolean autoCommitChild =
-            configuration.getChild( "auto-commit" ).getValueAsBoolean( true );
-        final boolean autoCommit =
-            controller.getAttributeAsBoolean( "auto-commit", autoCommitChild );
-        
+        final boolean autoCommit = configuration.getChild( "auto-commit" ).getValueAsBoolean( true );
         // Get the JdbcConnection class.  The factory will resolve one if null.
         final String connectionClass = controller.getAttribute( "connection-class", null );
 



---------------------------------------------------------------------
To unsubscribe, e-mail: scm-unsubscribe@excalibur.apache.org
For additional commands, e-mail: scm-help@excalibur.apache.org