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. Blocking Read of some rows.

Blocking Read of some rows.

Scheduled Pinned Locked Moved Database
sharepointsysadminhelpquestion
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.
  • D Offline
    D Offline
    DeathDragon
    wrote on last edited by
    #1

    I have a requirement that specifies that I need to block the access of a process to some records that are used by another process. This can be easily done by adding a Locked(bit) column and a ProcessID(int) column. The problem appears later in the specification when it says that in the case a process dies the rows locked have to be unlocked. The same must apply if the process is blocked in some way. Another problem is the fact that the login with which these processes run does not have VIEW SERVER STATE permission (nor it can be given that permission) so I can't use sysprocesses view or sp_who procedure. Is there any way around this or another possible solution?

    J C 2 Replies Last reply
    0
    • D DeathDragon

      I have a requirement that specifies that I need to block the access of a process to some records that are used by another process. This can be easily done by adding a Locked(bit) column and a ProcessID(int) column. The problem appears later in the specification when it says that in the case a process dies the rows locked have to be unlocked. The same must apply if the process is blocked in some way. Another problem is the fact that the login with which these processes run does not have VIEW SERVER STATE permission (nor it can be given that permission) so I can't use sysprocesses view or sp_who procedure. Is there any way around this or another possible solution?

      J Offline
      J Offline
      Jorgen Andersson
      wrote on last edited by
      #2

      You fail to mention what db you are using. If you use Oracle or DB2 you can Select for update... There's a similar method for SQL server but it locks whole pages instead of records as far as I know.

      "When did ignorance become a point of view" - Dilbert

      D 1 Reply Last reply
      0
      • J Jorgen Andersson

        You fail to mention what db you are using. If you use Oracle or DB2 you can Select for update... There's a similar method for SQL server but it locks whole pages instead of records as far as I know.

        "When did ignorance become a point of view" - Dilbert

        D Offline
        D Offline
        DeathDragon
        wrote on last edited by
        #3

        I am sorry, I forgot to mention I use MSSQL Server.

        1 Reply Last reply
        0
        • D DeathDragon

          I have a requirement that specifies that I need to block the access of a process to some records that are used by another process. This can be easily done by adding a Locked(bit) column and a ProcessID(int) column. The problem appears later in the specification when it says that in the case a process dies the rows locked have to be unlocked. The same must apply if the process is blocked in some way. Another problem is the fact that the login with which these processes run does not have VIEW SERVER STATE permission (nor it can be given that permission) so I can't use sysprocesses view or sp_who procedure. Is there any way around this or another possible solution?

          C Offline
          C Offline
          Chris Meech
          wrote on last edited by
          #4

          Just another idea. Could you select the data and then delete it from the table. The data would then have to be persisted in memory or perhaps a different table. Once the process is complete and want's to make the data 'visible' again, it would then restore it to the original table. :)

          Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

          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