Skip Headers

Oracle TopLink Developer's Guide 10g Release 3 (10.1.3) B13593-01 |
| Home | Solution Area | Contents | Index

Previous | Next |

# Configuring Cache Type and Size at the Project Level

The TopLink cache is an in-memory repository that stores recently read or written objects based on class and primary key values. TopLink uses the cache to:

- improve performance by holding recently read or written objects and accessing them in-memory to minimize database access

- manage locking and isolation level

- manage object identity

Table 22-12 summarizes which projects support identity map configuration.

Table 22-12 Project Support for Identity Map Configuration

Descriptor | Using TopLink Workbench | Using Java
--- | --- | ---
Relational Projects |  |
EIS Projects |  |
XML Projects |  |

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

You can override the project-level identity map configuration by defining identity map configuration at the descriptor level. For information on caching and defining identity map configuration for a specific descriptor, see "Configuring Cache Type and Size at the Descriptor Level".

Note: When using TopLink Workbench, changing the project's default identity map does not affect descriptors that already exist in the project; only newly added descriptors ar affected.

For detailed information on caching and object identity, and the recommended settings to maximize TopLink performance, see to "Cache Type and Object Identity".

For more information about the cache, see "Understanding the Cache".

## Using TopLink Workbench

To specify the cache identity map, 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-10 Defaults Tab, Identity Map Options

   Description of "Figure 22-10 Defaults Tab, Identity Map Options"

Use this table to enter data in each of the following fields to specify the caching options:

Field | Description
--- | ---
Type | Use the Type list to choose the identity map: Weak with Soft Subcache (`SoftCacheWeakIdentityMap`)–cache first n elements in soft space, anything after that in weak space (see "Soft and Hard Cache Weak Identity Maps") Weak with Hard Subcache (`HardCacheWeakIdentityMap`)–cache first n elements in soft space, anything after that in hard space (see "Soft and Hard Cache Weak Identity Maps") Weak (`WeakIdentityMap`)–cache everything in weak space (see "Weak Identity Map") Full (`FullIdentityMap`)–cache everything permanently (see "Full Identity Map") None (`NoIdentityMap`)–cache nothing (see "No Identity Map") For more information, see "Cache Type and Object Identity". Changing the project's default identity map does not affect descriptors that already exist in the project.
Size | Specify the size of the cache. When using Weak with Soft Subcache or Weak with Hard Subcache, the size is the maximum number of objects stored in the identity map. When using Full or Weak, the size indicates the starting size of the identity map.