Skip Headers

# Write Optimization Examples

Previous

Next

TopLink provides the write optimization features listed in Table: Write Optimization Features.

This section includes the following write optimization examples:

- Writing Case: Batch Writes

Write Optimization Features

Feature | Effect on Performance
--- | ---

Unit of Work

Improves performance by updating only the changed fields and objects.

Minimizes the amount of tracking required (which can be expensive) by registering only those objects that will change.

For more information, see Understanding TopLink Transactions).

Note: The Unit of Work supports marking classes as read-only (see "Configuring Read-Only Descriptors" and "Declaring Read-Only Classes"). This avoids tracking of objects that do not change.

Batch writing | Lets you group all insert, update, and delete commands from a transaction into a single database call. This dramatically reduces the number of calls to the database (see "Cursors" and "Batch Writing and Parameterized SQL").
Parameterized SQL | Improves performance for frequently executed SQL statements (see "Parameterized SQL and Prepared Statement Caching").
Sequence number preallocation | Dramatically improves insert performance. (see "Sequence Number Preallocation").
Multiprocessing | Splitting a batch job across threads lets you synchronize reads from a cursored stream and use parallel Units of Work for performance improvements even on a single machine (see "Multiprocessing").
Does exist alternatives | The does exist call on write object can be avoided in certain situations by checking the cache for does exist, or assuming the existence of the object (see "Configuring Existence Checking at the Project Level" or "Configuring Cache Existence Checking at the Descriptor Level" and "Using Registration and Existence Checking").

See Also

  Query Optimization
  Read Optimization Examples
  Optimization