You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by bl...@apache.org on 2002/11/05 05:34:02 UTC

cvs commit: jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/cluster AbstractDataSourceCluster.java DefaultHashedDataSourceCluster.java DefaultRoundRobinDataSourceCluster.java HashedDataSourceCluster.java IndexedDataSourceCluster.java

bloritsch    2002/11/04 20:34:02

  Modified:    datasource/src/java/org/apache/avalon/excalibur/datasource
                        AbstractJdbcConnection.java
               datasource/src/java/org/apache/avalon/excalibur/datasource/cluster
                        AbstractDataSourceCluster.java
                        DefaultHashedDataSourceCluster.java
                        DefaultRoundRobinDataSourceCluster.java
                        HashedDataSourceCluster.java
                        IndexedDataSourceCluster.java
  Log:
  fix compile error
  
  Revision  Changes    Path
  1.17      +14 -1     jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/AbstractJdbcConnection.java
  
  Index: AbstractJdbcConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/AbstractJdbcConnection.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- AbstractJdbcConnection.java	13 Jun 2002 17:24:50 -0000	1.16
  +++ AbstractJdbcConnection.java	5 Nov 2002 04:34:02 -0000	1.17
  @@ -42,6 +42,8 @@
       protected SQLException m_testException;
       protected long m_lastUsed = System.currentTimeMillis();
   
  +    protected Map m_statements;
  +
       /**
        * Private default constructor so that it cannot be instantiated any
        * other way than we desire.
  @@ -120,6 +122,17 @@
           try
           {
               m_connection.clearWarnings();
  +
  +            Iterator it = m_statements.getKeySet().iterator();
  +            while (it.hasNext())
  +            {
  +                Object key = it.next();
  +                Statement statement = (Statement)m_statements.get( key );
  +
  +                try { statement.close(); } catch ( SQLException se ) {}
  +
  +                m_statements.remove( key );
  +            }
           }
           catch( SQLException se )
           {
  
  
  
  1.3       +3 -3      jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/AbstractDataSourceCluster.java
  
  Index: AbstractDataSourceCluster.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/AbstractDataSourceCluster.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractDataSourceCluster.java	13 Jun 2002 17:24:51 -0000	1.2
  +++ AbstractDataSourceCluster.java	5 Nov 2002 04:34:02 -0000	1.3
  @@ -68,7 +68,7 @@
        * @throws NoValidConnectionException when there is no valid Connection wrapper
        *         available in the classloader or when the index is not valid.
        *
  -     * @throws NoAvailableConnectionException when there are no more available
  +     * @throws NoValidConnectionException when there are no more available
        *         Connections in the pool.
        */
       public Connection getConnectionForIndex( int index ) throws SQLException
  @@ -88,7 +88,7 @@
        * Called by the Container to tell the component which ComponentLocator
        *  is controlling it.
        *
  -     * @param ComponentLocator which curently owns the component.
  +     * @param manager which curently owns the component.
        */
       public void compose( ComponentManager manager )
       {
  
  
  
  1.2       +3 -3      jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/DefaultHashedDataSourceCluster.java
  
  Index: DefaultHashedDataSourceCluster.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/DefaultHashedDataSourceCluster.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultHashedDataSourceCluster.java	22 Apr 2002 03:04:27 -0000	1.1
  +++ DefaultHashedDataSourceCluster.java	5 Nov 2002 04:34:02 -0000	1.2
  @@ -144,7 +144,7 @@
        * @throws NoValidConnectionException when there is no valid Connection wrapper
        *         available in the classloader or when the index is not valid.
        *
  -     * @throws NoAvailableConnectionException when there are no more available
  +     * @throws NoValidConnectionException when there are no more available
        *         Connections in the pool.
        */
       public Connection getConnectionForHashObject( Object hashObject ) throws SQLException
  @@ -161,7 +161,7 @@
        * @throws NoValidConnectionException when there is no valid Connection wrapper
        *         available in the classloader or when the index is not valid.
        *
  -     * @throws NoAvailableConnectionException when there are no more available
  +     * @throws NoValidConnectionException when there are no more available
        *         Connections in the pool.
        */
       public Connection getConnectionForHashCode( int hashCode ) throws SQLException
  
  
  
  1.2       +2 -2      jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/DefaultRoundRobinDataSourceCluster.java
  
  Index: DefaultRoundRobinDataSourceCluster.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/DefaultRoundRobinDataSourceCluster.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultRoundRobinDataSourceCluster.java	22 Apr 2002 03:04:27 -0000	1.1
  +++ DefaultRoundRobinDataSourceCluster.java	5 Nov 2002 04:34:02 -0000	1.2
  @@ -99,7 +99,7 @@
        * @throws NoValidConnectionException when there is no valid Connection wrapper
        *         available in the classloader.
        *
  -     * @throws NoAvailableConnectionException when there are no more available
  +     * @throws NoValidConnectionException when there are no more available
        *         Connections in the pool.
        */
       public Connection getConnection() throws SQLException
  
  
  
  1.2       +7 -7      jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/HashedDataSourceCluster.java
  
  Index: HashedDataSourceCluster.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/HashedDataSourceCluster.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HashedDataSourceCluster.java	22 Apr 2002 03:04:27 -0000	1.1
  +++ HashedDataSourceCluster.java	5 Nov 2002 04:34:02 -0000	1.2
  @@ -37,10 +37,10 @@
        * @param hashObject Object whose hashCode will be used to select which of the Clusted
        *        DataSources will be provide a Connection.
        *
  -     * @throws NoValidConnectionException when there is no valid Connection wrapper
  +     * @throws org.apache.avalon.excalibur.datasource.NoValidConnectionException when there is no valid Connection wrapper
        *         available in the classloader or when the index is not valid.
        *
  -     * @throws NoAvailableConnectionException when there are no more available
  +     * @throws org.apache.avalon.excalibur.datasource.NoAvailableConnectionException when there are no more available
        *         Connections in the pool.
        */
       Connection getConnectionForHashObject( Object hashObject ) throws SQLException;
  @@ -51,10 +51,10 @@
        * @param hashCode HashCode which will be used to select which of the Clusted
        *        DataSources will be provide a Connection.
        *
  -     * @throws NoValidConnectionException when there is no valid Connection wrapper
  +     * @throws org.apache.avalon.excalibur.datasource.NoValidConnectionException when there is no valid Connection wrapper
        *         available in the classloader or when the index is not valid.
        *
  -     * @throws NoAvailableConnectionException when there are no more available
  +     * @throws org.apache.avalon.excalibur.datasource.NoAvailableConnectionException when there are no more available
        *         Connections in the pool.
        */
       Connection getConnectionForHashCode( int hashCode ) throws SQLException;
  @@ -64,10 +64,10 @@
        *
        * @param index Index of the DataSource for which a connection is to be returned.
        *
  -     * @throws NoValidConnectionException when there is no valid Connection wrapper
  +     * @throws org.apache.avalon.excalibur.datasource.NoValidConnectionException when there is no valid Connection wrapper
        *         available in the classloader or when the index is not valid.
        *
  -     * @throws NoAvailableConnectionException when there are no more available
  +     * @throws org.apache.avalon.excalibur.datasource.NoAvailableConnectionException when there are no more available
        *         Connections in the pool.
        */
       Connection getConnectionForIndex( int index ) throws SQLException;
  
  
  
  1.2       +3 -3      jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/IndexedDataSourceCluster.java
  
  Index: IndexedDataSourceCluster.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/IndexedDataSourceCluster.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- IndexedDataSourceCluster.java	22 Apr 2002 03:04:27 -0000	1.1
  +++ IndexedDataSourceCluster.java	5 Nov 2002 04:34:02 -0000	1.2
  @@ -36,10 +36,10 @@
        *
        * @param index Index of the DataSource for which a connection is to be returned.
        *
  -     * @throws NoValidConnectionException when there is no valid Connection wrapper
  +     * @throws org.apache.avalon.excalibur.datasource.NoValidConnectionException when there is no valid Connection wrapper
        *         available in the classloader or when the index is not valid.
        *
  -     * @throws NoAvailableConnectionException when there are no more available
  +     * @throws org.apache.avalon.excalibur.datasource.NoAvailableConnectionException when there are no more available
        *         Connections in the pool.
        */
       Connection getConnectionForIndex( int index ) throws SQLException;
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] DataSource doesn't compile, was: Re: cvs commit: ...

Posted by Peter Donald <pe...@apache.org>.
Applied the fix. Thanks!

On Tue, 5 Nov 2002 19:43, Jeremias Maerki wrote:
> Berin,
>
> unfortunately, your change introduced another compile error in
> AbstractJdbcConnection.java. Attached is a patch to fix it.
>
> On 5 Nov 2002 04:34:02 -0000 bloritsch wrote:
> > bloritsch    2002/11/04 20:34:02
> >
> >   Modified:    datasource/src/java/org/apache/avalon/excalibur/datasource
> >                         AbstractJdbcConnection.java
> >               
> > datasource/src/java/org/apache/avalon/excalibur/datasource/cluster
> > AbstractDataSourceCluster.java
> >                         DefaultHashedDataSourceCluster.java
> >                         DefaultRoundRobinDataSourceCluster.java
> >                         HashedDataSourceCluster.java
> >                         IndexedDataSourceCluster.java
> >   Log:
> >   fix compile error
>
> Jeremias Maerki

-- 
Cheers,

Peter Donald
----------------------------------------
Why does everyone always overgeneralize?
---------------------------------------- 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [PATCH] DataSource doesn't compile, was: Re: cvs commit: ...

Posted by Berin Loritsch <bl...@apache.org>.
> From: Jeremias Maerki [mailto:dev.jeremias@greenmail.ch] 
> 
> Berin,
> 
> unfortunately, your change introduced another compile error in
> AbstractJdbcConnection.java. Attached is a patch to fix it.


:(  Apparently, I accidentally committed more than I wanted to.
I was starting on the process of caching the result-sets and
statements so that when we returned the Connection object to the
pool, all the JDBC objects that were still opened were then closed.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


[PATCH] DataSource doesn't compile, was: Re: cvs commit: ...

Posted by Jeremias Maerki <de...@greenmail.ch>.
Berin,

unfortunately, your change introduced another compile error in
AbstractJdbcConnection.java. Attached is a patch to fix it.

On 5 Nov 2002 04:34:02 -0000 bloritsch wrote:
> bloritsch    2002/11/04 20:34:02
> 
>   Modified:    datasource/src/java/org/apache/avalon/excalibur/datasource
>                         AbstractJdbcConnection.java
>                datasource/src/java/org/apache/avalon/excalibur/datasource/cluster
>                         AbstractDataSourceCluster.java
>                         DefaultHashedDataSourceCluster.java
>                         DefaultRoundRobinDataSourceCluster.java
>                         HashedDataSourceCluster.java
>                         IndexedDataSourceCluster.java
>   Log:
>   fix compile error


Jeremias Maerki