예제 #1
0
 public static void FinishSession(UserContext userContext)
 {
     using (RecipientCacheTransaction recipientCacheTransaction = new RecipientCacheTransaction("OWA.AutocompleteCache", userContext))
     {
         AutoCompleteCache autoCompleteCache = AutoCompleteCache.TryGetCache(userContext);
         if (autoCompleteCache != null)
         {
             autoCompleteCache.FinishSession(new AutoCompleteCache(userContext, recipientCacheTransaction.Configuration), recipientCacheTransaction.Configuration);
         }
     }
 }
예제 #2
0
 public static void FinishSession(UserContext userContext)
 {
     if (userContext.IsSendFromCacheSessionStarted)
     {
         using (RecipientCacheTransaction recipientCacheTransaction = new RecipientCacheTransaction("OWA.SendFromCache", userContext))
         {
             SendFromCache sendFromCache = SendFromCache.TryGetCache(userContext);
             if (sendFromCache != null)
             {
                 sendFromCache.FinishSession(new SendFromCache(userContext, recipientCacheTransaction.Configuration), recipientCacheTransaction.Configuration);
             }
         }
     }
 }
예제 #3
0
 public static void FinishSession(UserContext userContext)
 {
     if (userContext.IsRoomsCacheSessionStarted)
     {
         using (RecipientCacheTransaction recipientCacheTransaction = new RecipientCacheTransaction("OWA.RoomsCache", userContext))
         {
             RoomsCache roomsCache = RoomsCache.TryGetCache(userContext);
             if (roomsCache != null)
             {
                 roomsCache.FinishSession(new RoomsCache(userContext, recipientCacheTransaction.Configuration), recipientCacheTransaction.Configuration);
             }
         }
     }
 }
예제 #4
0
 public override void Commit(bool mergeBeforeCommit)
 {
     if (base.IsDirty)
     {
         using (RecipientCacheTransaction recipientCacheTransaction = new RecipientCacheTransaction("OWA.SendFromCache", base.UserContext))
         {
             RecipientCache backEndRecipientCache = null;
             if (mergeBeforeCommit)
             {
                 backEndRecipientCache = new SendFromCache(base.UserContext, recipientCacheTransaction.Configuration);
             }
             this.Commit(backEndRecipientCache, recipientCacheTransaction.Configuration);
         }
     }
 }
예제 #5
0
 private static AutoCompleteCache GetCache(UserContext userContext, bool useInMemCache)
 {
     if (userContext.AutoCompleteCache == null || !useInMemCache)
     {
         using (RecipientCacheTransaction recipientCacheTransaction = new RecipientCacheTransaction("OWA.AutocompleteCache", userContext))
         {
             userContext.AutoCompleteCache = AutoCompleteCache.Load(userContext, recipientCacheTransaction.Configuration);
             if (!userContext.IsAutoCompleteSessionStarted)
             {
                 userContext.AutoCompleteCache.StartCacheSession();
                 userContext.IsAutoCompleteSessionStarted = true;
             }
         }
     }
     return(userContext.AutoCompleteCache);
 }
예제 #6
0
 private static SendFromCache GetCache(UserContext userContext, bool useInMemCache)
 {
     if (userContext.SendFromCache == null || !useInMemCache)
     {
         using (RecipientCacheTransaction recipientCacheTransaction = new RecipientCacheTransaction("OWA.SendFromCache", userContext))
         {
             userContext.SendFromCache = SendFromCache.Load(userContext, recipientCacheTransaction.Configuration);
             if (!userContext.IsSendFromCacheSessionStarted)
             {
                 userContext.SendFromCache.StartCacheSession();
                 userContext.SendFromCache.Commit(recipientCacheTransaction.Configuration);
                 userContext.IsSendFromCacheSessionStarted = true;
             }
         }
     }
     return(userContext.SendFromCache);
 }
예제 #7
0
 public override void Commit(bool mergeBeforeCommit)
 {
     if (base.IsDirty)
     {
         using (RecipientCacheTransaction recipientCacheTransaction = new RecipientCacheTransaction("OWA.AutocompleteCache", base.UserContext))
         {
             AutoCompleteCache backEndRecipientCache = null;
             if (mergeBeforeCommit)
             {
                 backEndRecipientCache = new AutoCompleteCache(base.UserContext, recipientCacheTransaction.Configuration);
             }
             this.Commit(backEndRecipientCache, recipientCacheTransaction.Configuration);
         }
     }
     if (base.UserContext.RoomsCache != null && base.UserContext.RoomsCache.IsDirty)
     {
         base.UserContext.RoomsCache.Commit(true);
     }
 }