private IDatabase GetDatabase(IDatabaseConnector databaseConnector, out IDatabaseLoader databaseLoader, List <SchemaData> tablesToFetch)
        {
            databaseLoader = null;
            _progress.SetCurrentState("Loading Database From Connection String in NHibernate Config File", ProgressState.Normal);

            databaseLoader = DatabaseLoaderFacade.GetDatabaseLoader(databaseConnector);
            databaseLoader.DatabaseObjectsToFetch = tablesToFetch;

            IDatabase database = null;
            bool      success  = false;

            while (success == false)
            {
                try
                {
                    database = databaseLoader.LoadDatabase(databaseLoader.DatabaseObjectsToFetch, null);
                    new DatabaseProcessor().CreateRelationships(database);
                    success = true;
                }
                catch (DatabaseLoaderException e)
                {
                    var loader = _userInteractor.GetDatabaseLoader(databaseConnector);
                    if (loader == null)
                    {
                        throw new NHibernateConfigException("Could not load the database specified in your config file.", e);
                    }
                    databaseLoader = loader;
                    _progress.SetCurrentState("Loading Database From Connection Information Given", ProgressState.Normal);
                }
            }
            return(database);
        }