Class CacheManager.DisableAutoUpdateScope
Scope class used to temporarily turn off auto-update of caches, based on table names
Implements
Inherited Members
Namespace: SuperOffice.Data.Cache
Assembly: SoDataBase.dll
Syntax
public class CacheManager.DisableAutoUpdateScope : 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.