Skip Headers

# Mapping and Descriptor Optimization

Previous

Next

Always use indirection. It is not only critical in optimizing database access, but also allows TopLink to make several other optimizations including optimizing its cache access and unit of work processing. See "Configuring Indirection".

Avoid using the existence checking option `checkCacheThenDatabase` on descriptors (see "Configuring Cache Existence Checking at the Descriptor Level"), unless required by the application. The default existence checking behavior offers better performance.

Avoid expensive initialization in the default constructor that TopLink uses to instantiate objects. Instead, use lazy initialization or use a TopLink instantiation policy (see "Configuring Instantiation Policy") to configure the descriptor to use a different constructor.

Avoid using method access in your TopLink mappings (see "Configuring Method Accessing"), especially if you have expensive or potentially dangerous side-effect code in your get or set methods; use the default direct attribute access instead.