serge       01/12/07 13:52:22

  Modified:    src/java/org/apache/james/transport/mailets JDBCAlias.java
                        JDBCListserv.java
  Log:
  Removed hack to wrap excalibur's db conn 'pooling' code.
  
  Revision  Changes    Path
  1.6       +2 -28     
jakarta-james/src/java/org/apache/james/transport/mailets/JDBCAlias.java
  
  Index: JDBCAlias.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/JDBCAlias.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JDBCAlias.java    2001/11/03 03:15:03     1.5
  +++ JDBCAlias.java    2001/12/07 21:52:22     1.6
  @@ -61,7 +61,7 @@
               // Get the data-source required.
               datasource = (DataSourceComponent)datasources.select(datasourceName);
   
  -            conn = getConnection();
  +            conn = datasource.getConnection();
   
               // Check if the required table exists. If not, complain.
               DatabaseMetaData dbMetaData = conn.getMetaData();
  @@ -103,7 +103,7 @@
           Collection recipientsToRemove = new Vector();
           Collection recipientsToAdd = new Vector();
           try {
  -            conn = getConnection();
  +            conn = datasource.getConnection();
               mappingStmt = conn.prepareStatement(query);
   
   
  @@ -153,32 +153,6 @@
   
       public String getMailetInfo() {
           return "JDBC aliasing mailet";
  -    }
  -
  -    /**
  -     * Opens a database connection.
  -     */
  -    protected Connection getConnection() {
  -        int attempts = 0;
  -        while (attempts < 1000) {
  -            try {
  -                return datasource.getConnection();
  -            } catch (SQLException e1) {
  -                if (e1.getMessage().equals("Could not create enough Components to 
service your request.")) {
  -                    //stupid pool
  -                    try {
  -                        Thread.sleep(50);
  -                    } catch (InterruptedException ie) {
  -                        //ignore
  -                    }
  -                    attempts++;
  -                } else {
  -                    throw new CascadingRuntimeException(
  -                        "An exception occurred getting a database connection.", e1);
  -                }
  -            }
  -        }
  -        throw new RuntimeException("Failed to get a connection after " + attempts + 
" attempts");
       }
   
       /**
  
  
  
  1.5       +2 -28     
jakarta-james/src/java/org/apache/james/transport/mailets/JDBCListserv.java
  
  Index: JDBCListserv.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/JDBCListserv.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JDBCListserv.java 2001/11/03 03:15:03     1.4
  +++ JDBCListserv.java 2001/12/07 21:52:22     1.5
  @@ -96,7 +96,7 @@
               // Get the data-source required.
               datasource = (DataSourceComponent)datasources.select(datasourceName);
   
  -            conn = getConnection();
  +            conn = datasource.getConnection();
   
               // Check if the required listserv table exists. If not, complain.
               DatabaseMetaData dbMetaData = conn.getMetaData();
  @@ -193,7 +193,7 @@
   
           try {
               //Load members
  -            conn = getConnection();
  +            conn = datasource.getConnection();
               stmt = conn.prepareStatement(membersQuery);
               stmt.setString(1, listservID);
               rs = stmt.executeQuery();
  @@ -251,32 +251,6 @@
   
       public String getMailetInfo() {
           return "JDBC listserv mailet";
  -    }
  -
  -    /**
  -     * Opens a database connection.
  -     */
  -    protected Connection getConnection() {
  -        int attempts = 0;
  -        while (attempts < 1000) {
  -            try {
  -                return datasource.getConnection();
  -            } catch (SQLException e1) {
  -                if (e1.getMessage().equals("Could not create enough Components to 
service your request.")) {
  -                    //stupid pool
  -                    try {
  -                        Thread.sleep(50);
  -                    } catch (InterruptedException ie) {
  -                        //ignore
  -                    }
  -                    attempts++;
  -                } else {
  -                    throw new CascadingRuntimeException(
  -                        "An exception occurred getting a database connection.", e1);
  -                }
  -            }
  -        }
  -        throw new RuntimeException("Failed to get a connection after " + attempts + 
" attempts");
       }
   
       /**
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to