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. Other Discussions
  3. The Weird and The Wonderful
  4. Mystery of the Missing (foreign) Keys

Mystery of the Missing (foreign) Keys

Scheduled Pinned Locked Moved The Weird and The Wonderful
database
6 Posts 6 Posters 0 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.
  • R Offline
    R Offline
    Rob Grainger
    wrote on last edited by
    #1

    A while back, I related the experience of losing FKs in a database, without having an inkling of what may have caused it. Various people came up with (reasonable) suggestions, like removing a constraint to facilitate adding records, or bulk inserts etc. However, I can now reveal the culprit. A product from a third party developer (who originally developed the system) that proceeded to go through the DB removing FKs without any attempt to reinstate them. The process was run a few months ago, luckily it looks like we only have a few cases of erroneous data resulting. This is a small miracle in itself.

    "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

    L J P 3 Replies Last reply
    0
    • R Rob Grainger

      A while back, I related the experience of losing FKs in a database, without having an inkling of what may have caused it. Various people came up with (reasonable) suggestions, like removing a constraint to facilitate adding records, or bulk inserts etc. However, I can now reveal the culprit. A product from a third party developer (who originally developed the system) that proceeded to go through the DB removing FKs without any attempt to reinstate them. The process was run a few months ago, luckily it looks like we only have a few cases of erroneous data resulting. This is a small miracle in itself.

      "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Rob Grainger wrote:

      However, I can now reveal the culprit. A product from a third party developer (who originally developed the system) that proceeded to go through the DB removing FKs without any attempt to reinstate them.

      "Sir, we're getting primary key exceptions!" "Ah, just remove the constraints from their database, that'll fix it." Makes me wonder about liability :)

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

      K 1 Reply Last reply
      0
      • R Rob Grainger

        A while back, I related the experience of losing FKs in a database, without having an inkling of what may have caused it. Various people came up with (reasonable) suggestions, like removing a constraint to facilitate adding records, or bulk inserts etc. However, I can now reveal the culprit. A product from a third party developer (who originally developed the system) that proceeded to go through the DB removing FKs without any attempt to reinstate them. The process was run a few months ago, luckily it looks like we only have a few cases of erroneous data resulting. This is a small miracle in itself.

        "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

        J Offline
        J Offline
        jeron1
        wrote on last edited by
        #3

        And they would have gotten away with it too, if it weren't for you meddling kids!

        "the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle

        1 Reply Last reply
        0
        • L Lost User

          Rob Grainger wrote:

          However, I can now reveal the culprit. A product from a third party developer (who originally developed the system) that proceeded to go through the DB removing FKs without any attempt to reinstate them.

          "Sir, we're getting primary key exceptions!" "Ah, just remove the constraints from their database, that'll fix it." Makes me wonder about liability :)

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

          K Offline
          K Offline
          Keith Barrow
          wrote on last edited by
          #4

          "RDBMSs are inefficient - we can hand-roll our own referential integrity in code, using a couple of junior devs, in less than a week" - Every development shop ever.

          KeithBarrow.net[^] - It might not be very good, but at least it is free!

          N 1 Reply Last reply
          0
          • K Keith Barrow

            "RDBMSs are inefficient - we can hand-roll our own referential integrity in code, using a couple of junior devs, in less than a week" - Every development shop ever.

            KeithBarrow.net[^] - It might not be very good, but at least it is free!

            N Offline
            N Offline
            Nathan Minier
            wrote on last edited by
            #5

            Essential for a fully abstracted repository layer, but if you're already married to a persistence technology...

            "There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli

            1 Reply Last reply
            0
            • R Rob Grainger

              A while back, I related the experience of losing FKs in a database, without having an inkling of what may have caused it. Various people came up with (reasonable) suggestions, like removing a constraint to facilitate adding records, or bulk inserts etc. However, I can now reveal the culprit. A product from a third party developer (who originally developed the system) that proceeded to go through the DB removing FKs without any attempt to reinstate them. The process was run a few months ago, luckily it looks like we only have a few cases of erroneous data resulting. This is a small miracle in itself.

              "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

              P Offline
              P Offline
              PIEBALDconsult
              wrote on last edited by
              #6

              The application must not rely on such things for proper functioning!

              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