

In other words, if more than one transections are running then they do not effect each other.ĭurability: It ensures that the effect of committed transactions will save in the database permanently and should persist no matter what happens (like in a power failure). Isolation: It ensures that transactions operate independently and are transparent to each other. In other words, if a transaction completes successfully then the database should be in a new state that will reflect changes else the transaction remains in the same state as at an initial point. Either it is performed completely or none of it is and at the point of failure the previous operations are rolled back to their former state.Ĭonsistency: Transactions ensure that the database properly changes states upon a successfully committed transaction. Now we will explain what “Transaction Management “ is and how it works.Ī transaction mainly consists of 4 properties that are also known as ACID rules.Ītomicity: Atomic means that all the work in the transaction is treated as a single unit. A transaction ensures that either a debit or a credit will be be done or nothing will be done. This means that we will lose the information.įor overcoming all these problems we can use transaction management. The result here would be that the Cust_A account will be debited, but the Cust_B account will not be credited. We are not required to do any retransmission, but the third condition will create a problem if, due to a technical problem, the first operation is successful but the second one fails. The first condition indicates a successful transaction and the second condition is not so critical.

Hence during the transaction life cycle no one can modify this table data used by the transaction such that the the integrity of the data for the transaction is maintained.Ī transaction is used when more than one table or view related to each other at a time are affected. When a transaction starts, it locks all the table data that is used in the transaction.

If any single statement fails then the entire transaction will fail and the complete transaction will be cancelled or rolled back. If statements are executed successfully then the transaction is complete and then it is committed that saves the data in the database permanently. It is a set of work (T-SQL statements) that are executed together such as a single unit in a specific logical order as a single unit. A transaction is a unit of work performed against the database.
