The SQL repository computes which properties are used in each query. When any of these properties are modified, the affected queries are invalidated. In addition, whenever an item of a given item type is added to or removed from the repository, all queries are invalidated in the query cache for that item descriptor. Item cache entries are invalidated when that item is updated.

When a set of properties of a repository item belonging to an item descriptor have been modified, the item descriptor fires a PropertiesChangedEvent (atg.repository.PropertiesChangedEvent). If you need specific notification when an item’s cache entry is invalidated, you can listen for these events.

The PropertyChangedEvent class has a type property that indicates the cause of the event. The value of type can be one of the following:

int Code

Value

Description

0

UPDATE

Properties of an item have been changed in this transaction.

1

DELETE

The item has been removed in this transaction.

2

INSERT

The item was newly added to the database.

3

CACHE_INVALIDATE

Some application code called the removeItemFromCache method on this item.

The PropertyChangedEvent class also has the following properties:

Property Name

Property Type

Description

item

RepositoryItem

The item that was changed. This is set to null if the item that was modified is not currently in the cache. In this case, look at the repositoryId property for the identity of the item that was changed.

repositoryId

String

This property can be set in place of the item property when the item itself is not in the cache and the origin of the event was in another server.

itemDescriptorName

String

The item descriptor name of the item modified in this transaction.

properties

Map

A map that has a RepositoryPropertyDescriptor as its key and the new property value as the value. If this value is null, specific detail about which properties were changed in this transaction is either not applicable or not available. For UPDATE events, a null properties map indicates that all properties in the item may have changed.

How and when cache invalidation is communicated across multiple ATG servers depends on the cache mode you select, as described in the Cache Modes section. You can also flush caches yourself, as described in the Cache Flushing section.

 
loading table of contents...