The transaction manager is responsible for coordinating the various objects. However, each object is responsible for managing its own phase, in other words, each object is responsible for the commit or rollback of its own data. More formally, a transaction is defined to have the ACID properties. ACID stands for atomicity, consistency, isolation and durability. Atomicity means that all operations in the transaction occur or none do.
Consistency means that, after the transaction, the system is in a consistent state.
Isolation means if there is more than one transaction, they do not interfere with one another. As the name implies, the commit is done in two phases or steps. When a client commits a transaction, the transaction manager will query all the objects that are part of the transaction as to whether they are ready to commit or not. An object is ready to commit if it guarantees that it will successfully process a commit request. If all the objects involved in the transaction are ready to commit, the transaction is successful.