jmcnally    2002/08/20 18:48:22

  Modified:    src/java/org/apache/torque/pool TorqueClassicDataSource.java
  Log:
  reverting previous changes as they will only help the situation if
  usernames lead to unique keys and there is no reason two different databases
  cannot use the same username.
  
  Revision  Changes    Path
  1.3       +3 -31     
jakarta-turbine-torque/src/java/org/apache/torque/pool/TorqueClassicDataSource.java
  
  Index: TorqueClassicDataSource.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/pool/TorqueClassicDataSource.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TorqueClassicDataSource.java      13 Aug 2002 16:39:09 -0000      1.2
  +++ TorqueClassicDataSource.java      21 Aug 2002 01:48:22 -0000      1.3
  @@ -419,15 +419,7 @@
                                                    String password)
           throws SQLException
       {
  -        String key = null;
  -        if (username != null)
  -        {
  -            key = getKey(username);
  -        }
  -        else
  -        {
  -            key = 
getKey(cpds.getPooledConnection().getConnection().getMetaData().getUserName());
  -        }
  +        String key = getKey(username);
           ConnectionPool pool = (ConnectionPool)pools.get(key);
           if ( pool == null )
           {
  @@ -452,37 +444,17 @@
       private String getKey(String suffix)
       {
           String key = getDataSourceName();
  -        if ( suffix != null && key != null)
  +        if ( suffix != null )
           {
               key += suffix;
           }
  -        else if (suffix != null)
  -        {
  -            return suffix;
  -        }
  -
           return key;
       }
   
       synchronized private void registerPool(String username, String password)
            throws javax.naming.NamingException
       {
  -        String key = null;
  -        if (username != null)
  -        {
  -            key = getKey(username);
  -        }
  -        else
  -        {
  -            try
  -            {
  -                key = 
getKey(cpds.getPooledConnection().getConnection().getMetaData().getUserName());
  -            }
  -            catch (SQLException e)
  -            {
  -                key = null;
  -            }
  -        }
  +        String key = getKey(username);
           if ( !pools.containsKey(key) )
           {
               ConnectionPoolDataSource cpds = this.cpds;
  
  
  

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

Reply via email to