Ejemplo n.º 1
0
 private void EndRequest(object sender, EventArgs e)
 {
     if (PersistenceContext.IsExisting)
     {
         if (PersistenceContext.SessionContext.IsDiagnosis)
         {
             string        loginName     = User.Current.LoginName;
             StringBuilder stringBuilder = new StringBuilder();
             stringBuilder.Append(loginName).Append(" ObjetkFrameworkWebAdapter ").Append("PersitentContextAutoFinish(Success:Accept) ")
             .Append(PersistenceContext.GetString());
             diagnosis.Info(stringBuilder);
         }
         if (!PersistenceContext.IsTransaction)
         {
             try
             {
                 PersistenceContext.Accept();
             }
             catch (Exception exception)
             {
                 log.Warn("自动结束(Accept)当前持久化上下文出错。", exception);
             }
         }
         else
         {
             PersistenceContext.Accept();
         }
     }
     PersistenceContext.ClearNotProcessedSuspendeds();
 }