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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Concurrency problem

Concurrency problem

Scheduled Pinned Locked Moved ASP.NET
helpcsharpdatabasequestionannouncement
2 Posts 2 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.
  • U Offline
    U Offline
    User 679214
    wrote on last edited by
    #1

    Dear friends, Please help me for the following problem. We have developed a web application in .net which allows user to buy refill cards online. Every refill card has pin codes attached to it. One refill card can have several pin codes. This pincode is sent to user in his mail of order confirmation. It is highly important that every user should get unique pincodes. Actually there is databse table which has refill card id, pincode, and one field which indicates whether the pincode is sold or not?(Y/N) We are showing refill cards whose pin codes are not sold i.e. soldstatus=N When he purchases a refill card with some x quantity then database should lock x pincodes for this refill card and when he confirms the order the soldstatus of all t hese records should be updated. But the problem is if he does not confirm order then these refill card should be available to purchase to other users. We can not update status of refill card unless the order is confirmed. If multiple users purchases then uniqueness of pincodes should also be maintained. This is basically a concurrency problem. Please help me. we are doing it in .net. regards. amol Tough Times never lasts but Tough people do!

    P 1 Reply Last reply
    0
    • U User 679214

      Dear friends, Please help me for the following problem. We have developed a web application in .net which allows user to buy refill cards online. Every refill card has pin codes attached to it. One refill card can have several pin codes. This pincode is sent to user in his mail of order confirmation. It is highly important that every user should get unique pincodes. Actually there is databse table which has refill card id, pincode, and one field which indicates whether the pincode is sold or not?(Y/N) We are showing refill cards whose pin codes are not sold i.e. soldstatus=N When he purchases a refill card with some x quantity then database should lock x pincodes for this refill card and when he confirms the order the soldstatus of all t hese records should be updated. But the problem is if he does not confirm order then these refill card should be available to purchase to other users. We can not update status of refill card unless the order is confirmed. If multiple users purchases then uniqueness of pincodes should also be maintained. This is basically a concurrency problem. Please help me. we are doing it in .net. regards. amol Tough Times never lasts but Tough people do!

      P Offline
      P Offline
      Pratik Desai
      wrote on last edited by
      #2

      If you are using oracle you can use select for update statement. If you are using MS Sql Server. MS SQL Server uses a read-lock everytime you read something,nobody is allowed to change the data if you are reading them, hence you can update the data if you are reading. Hope this helps.

      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