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. General Programming
  3. C#
  4. Dual running application using same database

Dual running application using same database

Scheduled Pinned Locked Moved C#
questiondatabasesysadmincareer
3 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
    dptalt
    wrote on last edited by
    #1

    I have an application that looks for the next job to process by querying a que table.   If it finds a record it does some processing for the corresponding job and then removes that record from the que table.   I want to have this application running on more then one server but I'm not sure the best way to keep each instance of the application from trying to process the same record in the que table.   Somehow when one instance of the application begins processing a record in the que table it needs to flag that record so that another instance of the application will not process it.   What is the best way to do this?

    J N 2 Replies Last reply
    0
    • D dptalt

      I have an application that looks for the next job to process by querying a que table.   If it finds a record it does some processing for the corresponding job and then removes that record from the que table.   I want to have this application running on more then one server but I'm not sure the best way to keep each instance of the application from trying to process the same record in the que table.   Somehow when one instance of the application begins processing a record in the que table it needs to flag that record so that another instance of the application will not process it.   What is the best way to do this?

      J Offline
      J Offline
      J4amieC
      wrote on last edited by
      #2

      If you return the info from your table and update the "Processing" flag from within a transaction, the other processes wont overlap due to l ocking caused by the transaction.

      1 Reply Last reply
      0
      • D dptalt

        I have an application that looks for the next job to process by querying a que table.   If it finds a record it does some processing for the corresponding job and then removes that record from the que table.   I want to have this application running on more then one server but I'm not sure the best way to keep each instance of the application from trying to process the same record in the que table.   Somehow when one instance of the application begins processing a record in the que table it needs to flag that record so that another instance of the application will not process it.   What is the best way to do this?

        N Offline
        N Offline
        Not Active
        wrote on last edited by
        #3

        I've used something like this in the past to synch applications Using SqlDependency for data change events[^]


        only two letters away from being an asset

        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