First page Back Continue Last page Text

oracle adf workshop


Business Components Transactions

An application module is a transactional container for a logical unit of work, so any updates, inserts or deletes for all view objects in the application module are committed or rolled back at once. The outermost, or root, application module provides the transaction context for all nested application modules.

At run time, the application module delegates transaction management to a companion Transaction object, which provides an entity cache as a work area to hold entity rows involved in the current user’s transaction. Each entity cache contains rows of a single entity type, so a transaction involving two or more entity objects holds the working copies of those entity rows in separate caches. The entity cache is also the place where new entity rows wait to be saved.

When an entity row is created, modified, or removed, it is automatically enrolled in the transaction’s list of pending changes. When you call commit() on the Transaction object, it processes its pending changes list, validating new or modified entity rows that might still be invalid. When the entity rows in the pending list are all valid, the Transaction issues a database SAVEPOINT and coordinates saving the entity rows to the database. If all goes successfully, it issues the final database COMMIT statement. If anything fails, the Transaction performs a ROLLBACK TO SAVEPOINT to allow the user to fix the error and try again.