Example #1
0
        public static void Initialize()
        {
            if (logger != null)
            {
                logger.Close();
            }

            //logger = new Logger.Logger(GFXDConfigManager.GetClientSetting("logDir"),
            //    String.Format("{0}.log", typeof(DbHelper).FullName));
            logger = new Logger.Logger(Environment.GetEnvironmentVariable("GFXDADOOUTDIR"),
                                       String.Format("{0}.log", typeof(DbHelper).FullName));
            locker = new object();

            try
            {
                GFXDServerMgr.Initialize();
                DbDefault.CreateDB(String.Empty, DbCreateType.Replicate);
            }
            catch (Exception e)
            {
                Log(GetExceptionDetails(e, new StringBuilder()).ToString());
                throw new Exception(
                          "Encountered exception in Helper.Initialize(). Check log for detail.");
            }
        }
Example #2
0
 public static void Cleanup()
 {
     try
     {
         DbDefault.DropDB(String.Empty);
     }
     catch (Exception e)
     {
         Log(GetExceptionDetails(e, new StringBuilder()).ToString());
         throw new Exception(
                   "Encountered exception in Helper.Cleanup(). Check log for detail.");
     }
     finally
     {
         GFXDServerMgr.Cleanup();
     }
 }