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. Web Development
  3. ASP.NET
  4. Can anyone explain in detail about DB LOCKING

Can anyone explain in detail about DB LOCKING

Scheduled Pinned Locked Moved ASP.NET
databasetutorialquestion
4 Posts 3 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.
  • S Offline
    S Offline
    Sathiyaraj Ganesan
    wrote on last edited by
    #1

    Many times i came across situations where multiple users updates the same set of records at the same time simultaneously. And i also came across situations while i am selecting a set of 100 records another process should not pick the same set of records.How to Implement this??? Can anyone explain in detail about DB LOCKING and how to retaining DB Integrity.. Whether to apply in Application end while querying or at DB end. And how to test whether LOCKING is implemented or not???

    Sathiya

    X 1 Reply Last reply
    0
    • S Sathiyaraj Ganesan

      Many times i came across situations where multiple users updates the same set of records at the same time simultaneously. And i also came across situations while i am selecting a set of 100 records another process should not pick the same set of records.How to Implement this??? Can anyone explain in detail about DB LOCKING and how to retaining DB Integrity.. Whether to apply in Application end while querying or at DB end. And how to test whether LOCKING is implemented or not???

      Sathiya

      X Offline
      X Offline
      xenonysf
      wrote on last edited by
      #2

      if you want to do atomic operations on db then see "transactions". But I have never used... Just wanted to say that all i know about them is that they provide u atomic operations CREATE PROCEDURE DeleteEmployee ( @EmployeeID int ) AS BEGIN TRANSACTION -- Start the transaction -- Delete the Employee's phone numbers DELETE FROM EmployeePhoneNumbers WHERE EmployeeID = @EmployeeID -- Delete the Employee record DELETE FROM Employees WHERE EmployeeID = @EmployeeID -- See if there is an error IF @@ERROR <> 0 -- There's an error b/c @ERROR is not 0, rollback ROLLBACK ELSE COMMIT -- Success! Commit the transaction

      C 1 Reply Last reply
      0
      • X xenonysf

        if you want to do atomic operations on db then see "transactions". But I have never used... Just wanted to say that all i know about them is that they provide u atomic operations CREATE PROCEDURE DeleteEmployee ( @EmployeeID int ) AS BEGIN TRANSACTION -- Start the transaction -- Delete the Employee's phone numbers DELETE FROM EmployeePhoneNumbers WHERE EmployeeID = @EmployeeID -- Delete the Employee record DELETE FROM Employees WHERE EmployeeID = @EmployeeID -- See if there is an error IF @@ERROR <> 0 -- There's an error b/c @ERROR is not 0, rollback ROLLBACK ELSE COMMIT -- Success! Commit the transaction

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        A transaction makes a group of operatons atomic, I don't think it locks the tables in question.

        Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        X 1 Reply Last reply
        0
        • C Christian Graus

          A transaction makes a group of operatons atomic, I don't think it locks the tables in question.

          Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          X Offline
          X Offline
          xenonysf
          wrote on last edited by
          #4

          aa yes but i just thought transactions can help about his problems :)

          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