What is 2 phase commit?

What is 2 phase commit?

- Distributed transactions are performed by relational databases.

- To ensure each and every transaction to perform in an orderly manner, a process is implemented. This process is called Two Phase Commit.

- In this process, the transactions termination occurs either by committing or rolling back them.

- It is a type of atomic commitment protocol.

- It achieves its goals even in the temporary system failures that is why they are used widely.

It consists of two phases:

1. commit request phase:
Here the coordinator process prepares all the transaction participating processes to take the necessary steps for committing or aborting the transaction.

2. commit phase:
It is based on the voting of the cohorts where the coordinator decides whether to commit or abort the transaction and notify the results to the cohorts. They will follow the required actions with local transactional resources and their respective portions in the transaction's other output.
Different types of resultset in JDBC
JDBC Resultset Types - Resultset contains results of the SQL query. There are 3 basic types of resultset...
Different transaction Isolation levels in JDBC
JDBC Isolation levels - Transaction Isolation levels is used to implement locking. They decide how one process isolated from other is. We have four ...
Explain optimistic and pessimistic locking in JDBC
JDBC Optimistic and Pessimistic locking - There are two kinds of locking available in JDBC.Optimistic Locking, Pessimistic Locking...
Post your comment