This illustration illustrates the interaction between the OracleAS TopLink caches and the other application components. The main cache in each OracleAS TopLink Session is the Session Cache. Each time an application performs a query, objects are returned to the application from the Session Cache if present, or read from the database, added to the Session Cache and returned to the application. When the application acquires a Unit of Work and commits a transaction, the Unit of Work writes its changes to the database. If the transaction is successful, the Unit of Work merges its changes into the Session Cache to keep the Session Cache in synchronization with the database. If the transaction is not successful (the changes attempted on the database are rolled back), the Unit of Work does not merge its changes into the Session Cache. In this way, while a transaction is active (and before commit), the Unit of Work maintains its changes in its own private cache.