Skip Headers

# Nested Unit of Work

Previous

Next

You can nest a unit of work (the child) within another unit of work (the parent). A nested unit of work does not commit changes to the database. Instead, it passes its changes to the parent unit of work, and the parent attempts to commit the changes at commit time. Nesting units of work lets you break a large transaction into smaller isolated transactions, and ensures that:

- Changes from each nested unit of work commit or fail as a group.

- Failure of a nested unit of work does not affect the commit or rollback transaction of other operations in the parent unit of work.

- Changes are presented to the database as a single transaction.