Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 597

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
ColdFusion ORM
After you have configured the secondary cache, it is critical to identify the objects in your application that can be
cached because the data cached by secondary cache is shared by all the sessions of an application. Typically, caching
should be enabled for a CFC that represents:
• Data that changes rarely
• Data that is local to an application and is not modified by other applications
• Non-critical data
For each type of object that needs to be cached, you also need to decide the access strategies. ORM provides the
following cache strategies that you can use for your objects:
• read-only
This strategy is useful for data that is read frequently but never updated. This is the best performing cache strategy.
• nonstrict-read-write
This strategy is useful for data that is updated occasionally. Typically, it is very unlikely that two transactions would
update the same object simultaneously.
• read-write
This strategy may be appropriate if your data needs to be updated. It carries more overhead than the two preceding
strategies.
• Transactional
This strategy provides the support for transactional cache. It can only be used if the cache provider is transaction
aware.
Support for these strategies depend on the cache provider. Not all the cache providers support all the cache strategies.
For more information on these strategies, see:
www.hibernate.org/hib_docs/reference/en/html/performance-cache.html
The secondary cache can cache the following types of data.
• Persistent object data
• Persistent object association
• Query data
Cache data of a persistent object
In this case, the data of the persistent object is cached. It will not cache the associations or associated object's data. To
enable this flag on a persistent CFC, specify the following attributes on the component.
: Defines the caching strategy.
cacheuse
: Defines the name of the cache region to be used by the secondary cache provider. If you do not specify
cachename
a region name for the component, the entity name of the component is considered as the cache name. In case a
region is not specified in the configuration file, a region is automatically created with the default configuration.
For example:
<cfcomponent persistent="true" schema="APP" table="Artists" cachename="artist"
cacheuse="read-only">
Last updated 1/20/2012
592

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents