Skip Headers
Oracle TopLink Developer's Guide
10g Release 3 (10.1.3)
B13593-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

Configuring Cache Expiration at the Project Level

By default, objects remain in the cache until they are explicitly deleted (see "Deleting Objects") or garbage-collected when using a weak identity map (see "Configuring Cache Type and Size at the Project Level"). Alternatively, you can configure an object with a CacheInvalidationPolicy that lets you specify, either automatically or manually, that an object is invalid: when any query attempts to read an invalid object, TopLink will go to the data source for the most up-to-date version of that object and update the cache with this information.

Using cache invalidation ensures that your application does not use stale data. It provides a better performing alternative to refreshing (see "Configuring Cache Refreshing").

Table 22-15 summarizes which projects support cache invalidation configuration.

Table 22-15 Project Support for Cache Invalidation Configuration

Descriptor Using TopLink Workbench
Using Java

Relational Projects

Supported.


Supported.


EIS Projects

Supported.


Supported.


XML Projects

Unsupported
Unsupported

The cache invalidation options you configure at the project level apply globally to all descriptors. Use this section to define global cache invalidation options for a TopLink project.

You can override the project-level cache invalidation configuration by defining cache invalidation at the descriptor (see "Configuring Cache Expiration at the Descriptor Level") or query level (see "Configuring Cache Expiration at the Query Level").

You can customize how TopLink communicates the fact that an object has been declared invalid to improve efficiency if you are using a coordinated cache. For more information, see "Configuring Cache Coordination Change Propagation at the Descriptor Level".


Note:

When using TopLink Workbench, changing the project's default cache invalidation does not affect descriptors that already exist in the project; only newly added descriptors are affected.

For more information, see "Cache Invalidation".

Using TopLink Workbench

To specify the cache invalidation options for the project, use this procedure:

  1. Select the project object in the Navigator.

  2. Select the Defaults tab in the Editor. The Defaults tab appears.

    Figure 22-13 Defaults Tab, Cache Expiry Options

    Description of Figure 22-13  follows
    Description of "Figure 22-13 Defaults Tab, Cache Expiry Options"

Use this table to enter data in the following fields on this tab:

Field Description
No Expiry Specify that objects in the cache do not expire.
Time to Live Expiry Specify that objects in the cache will expire after a specified amount of time. Use the Expire After field to indicate the time (in milliseconds) after which the objects will expire.
Daily Expiry Specify that objects in the cache will expire at a specific time each day. Use the Expire At field to indicate the exact time to the second (using a 24-hour clock) at which the objects will expire.
Update Read Time on Update Specify if the expiry time should be reset after updating an object.