Cleanup() public static method

public static Cleanup ( ) : void
return void
Ejemplo n.º 1
0
 public static void Stop()
 {
     if (Configuration.UnitOfWorkStorage.HasUnitOfWork)
     {
         IUnitOfWork uow = GetCurrentUnitOfWork();
         Transaction.Cleanup();
         CleanupUoW(uow);
     }
 }
Ejemplo n.º 2
0
        public static void Start(Action uowAction)
        {
            if (log.IsInfoEnabled)
            {
                log.Info(Consts.ENTERED);
            }

            CheckForUoWConfiguration();

            IUnitOfWork uow = null;

            try
            {
                uow = GetCurrentUnitOfWork();
                if (log.IsDebugEnabled)
                {
                    log.Debug("Starting uow...");
                }
                uow.Start();

                if (log.IsDebugEnabled)
                {
                    log.Debug("Executing uow...");
                }
                uowAction();
            }
            catch (Exception except)
            {
                if (log.IsErrorEnabled)
                {
                    log.Error(except);
                }
                throw;
            }
            finally
            {
                if (log.IsDebugEnabled)
                {
                    log.Debug("Cleaning up transaction...");
                }
                Transaction.Cleanup();

                CleanupUoW(uow);
            }
        }