Overview of Transactions¶
Let us go through the details related to Transactions.* We typically perform operations such as
ROLLBACK via the applications.
COMMITwill persist the changes in the database.
ROLLBACKwill revert the uncommitted changes in the database.
- We typically rollback the uncommitted changes in a transaction if there is any exception as part of the application logic flow.
- For example, once the order is placed all the items that are added to shopping cart will be rolled back if the payment using credit card fails.
- By default every operation is typically committed in Postgres. We will get into the details related to transaction as part of application development later.
- Commands such as
ROLLBACKtypically comes under TCL (Transaction Control Language)