Académique Documents
Professionnel Documents
Culture Documents
in
Consistency - This property implies that if the database was in a consistent state before the start of transaction
then upon termination of transaction the database will also be in a consistent state.
Isolation - this property implies that each transaction is unaware of other transactions executing concurrently in
the system.
Durability - This property of a transaction ensures that after the successfull completion of a transaction the
change made by it to the database persist even if there are system failures.
Q. What is Commit ?
Ans. the commit statement or commit work statement will save all of the changes made by the transaction. It
closes the current transaction and starts a new one.
Q. What is Rollback ?
Ans. This statement will discard or undo the changes made by the transaction and starts a new transaction. it
will undo the transaction to its starting point. Rollback can be of two types
1. Complete Rollback - it will undo the transaction to its starting point
2. Partial Rollback - it will undo the transaction to the specified savepoint.
Q What is a savepoint ?
Ans. Savepoints are special opeartions that allow you to divide the work of a transaction into different segments.
in case of a failure we can execute rollbacks to the savepoint only, through ROLLBACK to SAVEPOINT
command. These are also called as checkpoints.
To check the current setting of autocommit we have to issue the following command
select @@autocommit;
to set the autocommit we have to issue the following command
set autocommit = 0 or set autocommit =1 (by default on)
Practical
1. set autocommit=0
3. start transaction
7. savepoint s1
or
12. rollback to s1 - it will remove only 104,105 and 106 which are inserted after the savepoint s1
or