private synchronized void initialize() throws TorqueException {
    log.debug("initialize()");

    if (isInit) {
      log.debug("Multiple initializations of Torque attempted");
      return;
    }

    if (conf == null || conf.isEmpty()) {
      throw new TorqueException(
        "Torque cannot be initialized without "
        + "a valid configuration. Please check the log files "
        + "for further details.");
    }

    // Now that we have dealt with processing the log4j properties
    // that may be contained in the configuration we will make the
    // configuration consist only of the remain torque specific
    // properties that are contained in the configuration. First
    // look for properties that are in the "torque" namespace.

    Configuration subConf = conf.subset(Torque.TORQUE_KEY);
    if (subConf == null || subConf.isEmpty()) {
      String error = ("Invalid configuration. No keys starting with "
        + Torque.TORQUE_KEY
        + " found in configuration");
      log.error(error);
      throw new TorqueException(error);
    }
    setConfiguration(subConf);

    initDefaultDbName(conf);
    initAdapters(conf);
    initDataSourceFactories(conf);

    // setup manager mappings
    initManagerMappings(conf);

    isInit = true;

    // re-build any MapBuilders that may have gone lost during serialization
    synchronized (mapBuilderCache) {
      for (Iterator i = mapBuilderCache.entrySet().iterator(); i.hasNext();) {
        Map.Entry entry = (Map.Entry) i.next();

        if (null == entry.getValue()) {
          try {
            // create and build the MapBuilder
            MapBuilder builder = (MapBuilder) Class.forName((String) entry.getKey()).newInstance();

            if (!builder.isBuilt()) {
              builder.doBuild();
            }

            entry.setValue(builder);
          } catch (Exception e) {
            throw new TorqueException(e);
          }
        }
      }
    }
  }