Changeset 16652

Show
Ignore:
Timestamp:
05.08.2008 14:36:54 (11 years ago)
Author:
shaoqun
Message:

remove the caching of DBWrapper

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/src/java/org/greenstone/gsdl3/sql/DatabaseFactory.java

    r15948 r16652  
    1212public class DatabaseFactory{ 
    1313    private static HashMap serverMap = new HashMap(); 
    14     private static HashMap wrapperMap = new HashMap(); 
    1514    private static Logger logger = Logger.getLogger(org.greenstone.gsdl3.sql.DatabaseFactory.class.getName()); 
    1615 
     
    6766    public static final MetadataDBWrapper getMetadataDBWrapper(String dbname, String sqlstate){ 
    6867    dbname = properDBName(dbname); 
    69     if (wrapperMap.containsKey(dbname + ":" + sqlstate)) return (MetadataDBWrapper)wrapperMap.get(dbname + ":" + sqlstate);  
    7068 
    7169    String fullName = "org.greenstone.gsdl3.sql." + dbname.toLowerCase()+ "." + dbname +"DBWrapper"; 
     
    8583           if (state != null){ 
    8684               wrapper.setSQLStatements(state);  
    87                wrapperMap.put(dbname + ":" + sqlstate, wrapper); 
    8885               return wrapper; 
    8986           } 
     
    9592            if (state != null){ 
    9693                wrapper.setSQLStatements(state); 
    97                 wrapperMap.put(dbname + ":" + sqlstate,wrapper); 
    9894                return wrapper; 
    9995            }