Skip Headers

# Unit of Work Benefits

Previous

Next

The TopLink unit of work simplifies transactions and improves transactional performance. It is the preferred method of writing to a database in TopLink because it performs the following:

- Sends a minimal amount of SQL to the database during the commit by updating only the exact changes down to the field level

- Reduces database traffic by isolating transaction operations in their own memory space

- Optimizes cache coordination, in applications that use multiple caches, by passing change sets (rather than objects) between caches

- Isolates object modifications in their own transaction space to allow parallel transactions on the same objects

- Ensures referential integrity and minimizes deadlocks by automatically maintaining SQL ordering

- Orders database insert, update, and delete operations to maintain referential integrity for mapped objects

- Resolves bidirectional references automatically

- Frees the application from tracking or recording its changes

- Simplifies persistence with persistence by reachability (see "Associating a New Source to an Existing Target Object")