Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. integrity constraint

integrity constraint

Scheduled Pinned Locked Moved Database
databaseperformancequestion
4 Posts 3 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tara11
    wrote on last edited by
    #1

    The quote below is from An Introduction to Database Systems, 8th edition, C J Date. Is that possible systems crash while transferring updates from the physical device to the database? If yes, since transactions are the unit of recovery, those updates that are written to the database should be undone?

    "It is quite possible, for instance, that the system might crash after the COMMIT has been honored but before the updates have been physically written to the database--they might still be waiting in a main-memory buffer and so lost at the time of the crash. Even if that happens, the system's restart procedure will still record those updates in the database: it is able to discover the values to be written by examining the relevant records in the log."

    W 1 Reply Last reply
    0
    • T Tara11

      The quote below is from An Introduction to Database Systems, 8th edition, C J Date. Is that possible systems crash while transferring updates from the physical device to the database? If yes, since transactions are the unit of recovery, those updates that are written to the database should be undone?

      "It is quite possible, for instance, that the system might crash after the COMMIT has been honored but before the updates have been physically written to the database--they might still be waiting in a main-memory buffer and so lost at the time of the crash. Even if that happens, the system's restart procedure will still record those updates in the database: it is able to discover the values to be written by examining the relevant records in the log."

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      Not sure if I understand the question correctly, but are you looking for [Rollforward?](https://en.wikipedia.org/wiki/Transaction\_processing#Rollforward) . With rollforward, when the database is recovered, all the logs are reapplied and in the end, everything that is not committed is rolled back. This guarantees a consisted situation even after crash. If the recovery is interrupted because of a new crash, the recovery is simply started from the beginning next time.

      T 1 Reply Last reply
      0
      • W Wendelius

        Not sure if I understand the question correctly, but are you looking for [Rollforward?](https://en.wikipedia.org/wiki/Transaction\_processing#Rollforward) . With rollforward, when the database is recovered, all the logs are reapplied and in the end, everything that is not committed is rolled back. This guarantees a consisted situation even after crash. If the recovery is interrupted because of a new crash, the recovery is simply started from the beginning next time.

        T Offline
        T Offline
        Tara11
        wrote on last edited by
        #3

        Many thanks! Sorry can you please explain this: If the system crash after the COMMIT has been honored but just part of the updates have been physically written to the database other parts are still waiting in a main-memory buffer, then what will happen? How they know that just part of the data is written?

        M 1 Reply Last reply
        0
        • T Tara11

          Many thanks! Sorry can you please explain this: If the system crash after the COMMIT has been honored but just part of the updates have been physically written to the database other parts are still waiting in a main-memory buffer, then what will happen? How they know that just part of the data is written?

          M Offline
          M Offline
          markkuk
          wrote on last edited by
          #4

          It's explained in the text you quoted:

          "... the system's restart procedure will still record those updates in the database: it is able to discover the values to be written by examining the relevant records in the log."

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups