Show / Hide Table of Contents

Class CacheManager.DisableAutoUpdateScope

Scope class used to temporarily turn off auto-update of caches, based on table names

Inheritance
Object
CacheManager.DisableAutoUpdateScope
Implements
IDisposable
Namespace: SuperOffice.Data.Cache
Assembly: SoDataBase.dll
Syntax
public class DisableAutoUpdateScope : Object, IDisposable
Remarks

Usage:

using(UserGroupCache.GetCurrent().BeginDisableAutoUpdate())
{
   ... lots of updates to usergroup or usergrouplink tables
}

When the class is created, the disable-count for all tables belonging to the cache will be incremented, and automatic updates (via softtriggers from insert/update/delete sql) will be disabled. When the class is disposed, the corresponding caches will be updated once. If the disable-count falls to zero, then auto-update will also be reenabled.

Constructors

DisableAutoUpdateScope(IEnumerable<String>)

Enter scope - disable auto-update of caches depending on any of the given tables

Declaration
public DisableAutoUpdateScope(IEnumerable<string> namesToDisable)
Parameters
Type Name Description
IEnumerable<String> namesToDisable
Remarks

Usage:

using(UserGroupCache.GetCurrent().BeginDisableAutoUpdate())
{
   ... lots of updates to usergroup or usergrouplink tables
}

When the class is created, the disable-count for all tables belonging to the cache will be incremented, and automatic updates (via softtriggers from insert/update/delete sql) will be disabled. When the class is disposed, the corresponding caches will be updated once. If the disable-count falls to zero, then auto-update will also be reenabled.

Methods

Dispose()

Exit scope - decrement disable-count of each given table; update each dependent cache once; wait for cache update to complete

Declaration
public void Dispose()
Remarks

Usage:

using(UserGroupCache.GetCurrent().BeginDisableAutoUpdate())
{
   ... lots of updates to usergroup or usergrouplink tables
}

When the class is created, the disable-count for all tables belonging to the cache will be incremented, and automatic updates (via softtriggers from insert/update/delete sql) will be disabled. When the class is disposed, the corresponding caches will be updated once. If the disable-count falls to zero, then auto-update will also be reenabled.

Implements

IDisposable

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top