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 2005/06/05 16:49:09 UTC

svn commit: r180098 - in /excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource: AbstractJdbcConnection.java JdbcConnectionPool.java PoolSettable.java ResourceLimitingJdbcConnectionPool.java

Author: leif
Date: Sun Jun  5 07:49:07 2005
New Revision: 180098

URL: http://svn.apache.org/viewcvs?rev=180098&view=rev
Log:
Fix a bad bug where the setAutoCommit method of Connections was being ignored.  This meant that it was impossible to make use of transactions unless the pool as a whole was setup so that its auto commit mode was false.

Modified:
    excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/AbstractJdbcConnection.java
    excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/JdbcConnectionPool.java
    excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/PoolSettable.java
    excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/ResourceLimitingJdbcConnectionPool.java

Modified: excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/AbstractJdbcConnection.java
URL: http://svn.apache.org/viewcvs/excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/AbstractJdbcConnection.java?rev=180098&r1=180097&r2=180098&view=diff
==============================================================================
--- excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/AbstractJdbcConnection.java (original)
+++ excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/AbstractJdbcConnection.java Sun Jun  5 07:49:07 2005
@@ -56,7 +56,6 @@
         implements PoolSettable, Disposable, ProxiedJdbcConnection
 {
     protected Connection m_connection;
-    protected boolean m_autoCommit;
 
     private Object m_proxy;
     protected Pool m_pool;
@@ -200,14 +199,6 @@
     public Connection getConnection()
     {
         return m_connection;
-    }
-
-    /**
-     * @see org.apache.avalon.excalibur.datasource.PoolSettable#setAutoCommit
-     * @todo this method only stores the auto commit flag but does not modify the connection.  Should it?
-     */
-    public void setAutoCommit(boolean autoCommit){
-        m_autoCommit = autoCommit;
     }
 
     public boolean isClosed()

Modified: excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/JdbcConnectionPool.java
URL: http://svn.apache.org/viewcvs/excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/JdbcConnectionPool.java?rev=180098&r1=180097&r2=180098&view=diff
==============================================================================
--- excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/JdbcConnectionPool.java (original)
+++ excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/JdbcConnectionPool.java Sun Jun  5 07:49:07 2005
@@ -151,7 +151,7 @@
 
         PoolSettable obj = (PoolSettable)super.get();
 
-        if( obj.isClosed() )
+        if( ((Connection)obj).isClosed() )
         {
             if( getLogger().isDebugEnabled() )
             {

Modified: excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/PoolSettable.java
URL: http://svn.apache.org/viewcvs/excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/PoolSettable.java?rev=180098&r1=180097&r2=180098&view=diff
==============================================================================
--- excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/PoolSettable.java (original)
+++ excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/PoolSettable.java Sun Jun  5 07:49:07 2005
@@ -36,9 +36,5 @@
      * @param pool
      */
     void setPool( Pool pool );
-    
-    boolean isClosed() throws SQLException;
-    
-    void setAutoCommit( boolean autoCommit ) throws SQLException;
 }
 

Modified: excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/ResourceLimitingJdbcConnectionPool.java
URL: http://svn.apache.org/viewcvs/excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/ResourceLimitingJdbcConnectionPool.java?rev=180098&r1=180097&r2=180098&view=diff
==============================================================================
--- excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/ResourceLimitingJdbcConnectionPool.java (original)
+++ excalibur/trunk/components/datasource/src/java/org/apache/avalon/excalibur/datasource/ResourceLimitingJdbcConnectionPool.java Sun Jun  5 07:49:07 2005
@@ -124,7 +124,7 @@
             //  used for a while.  Is this a problem because the m_semaphore
             //  is currently locked?  I am thinking no because isClosed() will
             //  return immediately when connections are being used frequently.
-            if( conn.isClosed() )
+            if( ((Connection)conn).isClosed() )
             {
                 getLogger().debug( "JdbcConnection was closed." );
                 return false;
@@ -132,7 +132,7 @@
             
             // Always reset the auto commit flag in case a previous user has modified it.
             //  If the user forgot to commit then this may cause a commit.
-            conn.setAutoCommit( m_autoCommit );
+            ((Connection)conn).setAutoCommit( m_autoCommit );
         }
         catch( SQLException e )
         {



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