ePages 6.0 Patch 6 - DE_EPAGES/DataCache/API/SharedCache.pm

Package DE_EPAGES::DataCache::API::SharedCache

This package provides an interface to cache data. To save a entry at cache use GetCache. The returned hash is a tied hash, which checks if the maximum count of elements is reached. Otherwise the tied-hash works like normal standard perl hash. To update the cache on other application servers use UpdateCache.

@EXPORT_OK
GetCache
UpdateCache
UpdateLocal

Functions

GetCache
UpdateCache
UpdateLocal

GetCache

Gets a named cache. Creates a cache if not exists.

Syntax
$NamedCache = GetCache($ConnectionKey, $CacheName);
Example
use DE_EPAGES::Database::API::Connection qw (  GetCurrentDBHandle );
my $dbi = GetCurrentDBHandle();
$NamedCache = GetCache($dbi->cacheKey, 'InfoYourObject');
Input
$ConnectionKey (string)
indentifier of connection
$CacheName (string)
name of cache
Return
$NamedCache (ref.hash)
data

UpdateCache

Deletes the cache entry, and adds an item to touched cache (to inform the message center about the changes). If no parameter is submitted then the complete cache will be cleared.

Syntax
UpdateCache($ConnectionKey, $CacheName, $Parameter);
Input
$ConnectionKey (string)
indentifier of connection
$CacheName (string)
name of cache
$Parameter (string)
which entry should be deleted (optional)

UpdateLocal

Deletes all local caches, dont inform other appserver (in case of transaction rollback).

Syntax
UpdateLocal();