You get a bonus - 1 coin for daily activity. Now you have 1 coin

12.2. Individual transaction rollback

Lecture



In order to be able to perform an individual rollback on the general log, all log entries from this transaction are linked to the reverse list. The beginning of the list for pending transactions is the record of the last database change made by this transaction. For completed transactions (individual rollbacks of which are no longer possible), the beginning of the list is the record of the end of the transaction, which is necessarily pushed into the external log memory. The end of the list is always the first record of a database change made by this transaction. Typically, each record contains a unique transaction identifier so that you can restore a direct list of database change records for a given transaction.

So, an individual transaction rollback (we emphasize again that this is possible only for incomplete transactions) is performed as follows:

  • The next entry is selected from the list of this transaction.
  • The opposite operation is performed: instead of the INSERT operation, the corresponding DELETE operation is performed, instead of the DELETE operation, an INSERT operation is performed, and instead of the direct UPDATE operation, the inverse UPDATE operation, which restores the previous state of the database object.
  • Any of these reverse operations are also logged. Actually, for an individual rollback, this is not necessary, but when performing an individual rollback of a transaction, a mild failure may occur, when recovering from which you will need to roll back such a transaction for which an individual rollback is not fully performed.
  • Upon successful completion of a rollback, a record of the end of the transaction is recorded. From a journal point of view, such a transaction is committed.

Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

IBM System R — реляционная СУБД

Terms: IBM System R — реляционная СУБД