Oracle TopLink Developer's Guide 10g Release 3 (10.1.3) B13593-01 |
|
![]() Previous |
![]() Next |
To configure the TopLink cache, you use the appropriate API in the following objects:
You configure object identity using the Descriptor
API summarized in Example 90-1.
For more information, see "Configuring Cache Type and Size at the Descriptor Level".
You configure cache refresh using the Descriptor
API summarized in Example 90-2.
For more information, see "Configuring Cache Refreshing".
You configure cache invalidation using Descriptor
methods getCacheInvalidationPolicy
and setCacheInvalidationPolicy
to configure an oracle.toplink.descriptors.invalidation.CacheInvalidationPolicy
.
You can use any of the following CacheInvalidationPolicy
instances:
DailyCacheInvalidationPolicy
: The object is automatically flagged as invalid at a specified time of day.
NoExpiryCacheInvalidationPolicy
: The object can only be flagged as invalid by explicitly calling oracle.toplink.sessions.IdentityMapAccessor
method invalidateObject
.
TimeToLiveCacheInvalidationPolicy
: The object is automatically flagged as invalid after a specified time period has elapsed since the object was read.
For more information, see the following:
You configure cache coordination using the Session
methods summarized in Example 90-3.
You configure how object changes are propagated using the Descriptor
methods summarized in Example 90-4.
For more information, see "Configuring Common Coordinated Cache Options".
Example 90-3 Cache Coordination Session API
Session.getCommandManager() setShouldPropagateAsynchronously(boolean) Session.getCommandManager().getDiscoveryManager() setAnnouncementDelay() setMulticastGroupAddress() setMulticastPort() setPacketTimeToLive() Session.getCommandManager().getTransportManager() setEncryptedPassword() setInitialContextFactoryName() setLocalContextProperties(Hashtable) setNamingServiceType() passing in one of: TransportManager.JNDI_NAMING_SERVICE TransportManager.REGISTRY_NAMING_SERVICE setPassword() setRemoteContextProperties(Hashtable) setShouldRemoveConnectionOnError() setUserName()