Transcript for:
Transaction Management in DBMS

Hi students, welcome back. Coming to our next topic that is transaction management. So let us see what is this transaction management in database management system. So a transaction management is nothing but it is a program unit. You call it is a program unit. And you call it a transaction unit. Execution whose execution may change the content of database so that you call it as a transaction management so here the transaction management is a program unit whose execution may change the content of database so what it means what is the whose whose execution may change the content of database suppose you are having a one bank database is there so in a one particular bank you are having some account so database is there so here the transaction means whose execution may change the content of database so how this database content will be changed with the help of some select you are selecting the database and you are doing some insert by using insert operations means you are transferring the money to the bank okay you are depositing the money deposit so whenever you deposit the money in the database in your account the content of database is changing so that is one of one type of transaction suppose if you update you are transferring the data from one account to the another account okay so here also whose execution may change the content of database the database content is changing so that you call it as a transaction so selecting one type of transaction inserting the account amount depositing the amount in your account is changing the content of database. So that is one type of a transaction. And updating the account by transferring the amount from one account to another account. So these are all the operations that are used to change the content of database. So those you call it as a transactions. So doing a simple operation you call it as a transaction. So a database. Before a transaction and the database after transaction. okay after transaction it should be same means it should be consistent then only you can say the whatever the transactions you made on the database is valid okay database before transaction and after transactions it should be in consistent state it should be in consistent state actually the consistent state is nothing but it is a correct consistent means the correct uh values or the correct database okay so database before transaction so before transaction and after transaction also it should be in consistency how it is in consistent state so let us see the example let us do one transaction okay suppose in your account you are having the money uh you in your account the amount will be suppose 300 is the amount in your account account a so in another account you are having the amount like okay so 400 so in another account the amount you are having the for 400 now you want to transfer the hundred rupees hundred rupees from a to B So, from A to B, from account A to account B, you want to transfer the money. 100 rupees you want to transfer. Means you want to do some transaction on the database of your account. Okay. So, transferring, modifying the data. So, how? First, read A. R means suppose read A. So, 300 is read. So, after that you have to be A minus 100. means you are transferring the 100 amount. So, 100 will be deducted from your account. And write A. So, now your account is having 200. Okay? You transfer the amount. So, after that, read. B. Okay, 400 is read. B is equal to B plus 100 because the 100 is taken from account A. The amount is transferred. So, this is the general mathematic problem. So, here we are just adding the removing the 100 rupees. We are transferring 100 rupees to B. So, now B is equal to B plus 100. Now, write. B. So now B value is 400 plus 1, 500. Okay. So here you have to observe. Before transaction, the account value before transaction A plus B is 700. 400 plus 300. So after transaction, after transaction. A plus B that is 200 plus 500, 700. Okay? After transaction A plus B is also 700. Then you can say the database is in consistent state without any problem. So before transaction after transaction the database should be in consistent state. To make the database into consistent state we will use some properties on transaction. So actually whatever you have created. okay suppose whatever you have created a database that always in consistent state okay first you created a database so the database is always in consistent state it is in correct state okay so now what we have to do the main thing here we have to note that the transactions the dot doing on the database the transactions that are we are doing on the database should be consistent so whatever the transactions that we are making on the database like select update delete modify okay commit so all the transactions that are we are doing on the database should be always in consistent that we have to be you noted okay so to make the transaction into consistent state we will use some properties okay those you call it as acid properties if transaction satisfies if transaction satisfies the acid properties Then you can say that your transaction is maintaining database consistency. So if your transaction satisfies all the ACID properties, atomicity, consistency, isolation and durability. So these are all the different ACID properties. So if your transaction satisfies all these ACID properties, then you can say that transaction whatever you are doing on the database is consistent and it makes your database in a consistent state. So the successful transactions always change the database from one consistent state to another consistent state. A successful transaction. changes the database from one consistent state to another consistent state. So this is the transaction. So this is the transaction management to maintain the transactions, whatever the transactions that are we are doing on the database to maintain those transaction is a consistent. We have to satisfy the asset properties. So we will use the asset properties. So with the help of the asset properties, we can ensure that whatever the request we are giving to the database that should be in consistent state. Thank you.