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. Visual Basic
  4. VB.NET Handle SQL DB in Multi user application

VB.NET Handle SQL DB in Multi user application

Scheduled Pinned Locked Moved Visual Basic
databasecsharpquestion
8 Posts 4 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.
  • A Offline
    A Offline
    All Time Programming
    wrote on last edited by
    #1

    I have an vb.net application that is being used by multi-users. I execute all sql statements in a seperate block all at one time one after another. Many times it so happens that 2 records (referrenced by 2 persons) are stored in a single id which should be stored in different id. What should I do to avoid this type of conflict ? Thanks & Regards,

    A 1 Reply Last reply
    0
    • A All Time Programming

      I have an vb.net application that is being used by multi-users. I execute all sql statements in a seperate block all at one time one after another. Many times it so happens that 2 records (referrenced by 2 persons) are stored in a single id which should be stored in different id. What should I do to avoid this type of conflict ? Thanks & Regards,

      A Offline
      A Offline
      AspDotNetDev
      wrote on last edited by
      #2

      Use identity columns so that the ID's are generated automatically.

      [Managing Your JavaScript Library in ASP.NET]

      A 1 Reply Last reply
      0
      • A AspDotNetDev

        Use identity columns so that the ID's are generated automatically.

        [Managing Your JavaScript Library in ASP.NET]

        A Offline
        A Offline
        All Time Programming
        wrote on last edited by
        #3

        Thanks AspDotNetDev, Its a high-end reqd to generate ID programmatically and not auto. Thanks & Regards,

        T D 2 Replies Last reply
        0
        • A All Time Programming

          Thanks AspDotNetDev, Its a high-end reqd to generate ID programmatically and not auto. Thanks & Regards,

          T Offline
          T Offline
          Thomas Krojer
          wrote on last edited by
          #4

          tell your customer that he made an request which is VERY EXPANSIVE to handle - he will agree with identity columns.

          I cannot remember: What did I before google?

          1 Reply Last reply
          0
          • A All Time Programming

            Thanks AspDotNetDev, Its a high-end reqd to generate ID programmatically and not auto. Thanks & Regards,

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            Well, then you have a serious design flaw in your database. One which will take a redesign to fix and a major overhaul of your code.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak

            A 1 Reply Last reply
            0
            • D Dave Kreskowiak

              Well, then you have a serious design flaw in your database. One which will take a redesign to fix and a major overhaul of your code.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak

              A Offline
              A Offline
              All Time Programming
              wrote on last edited by
              #6

              Thanks AspDotNet, Thomas, Dave. >>One which will take a redesign to fix and a major overhaul of your code. Dave, can you explain a bit on what are you trying to say and how and what factors to look for in the code. Thanks & Regards,

              D 1 Reply Last reply
              0
              • A All Time Programming

                Thanks AspDotNet, Thomas, Dave. >>One which will take a redesign to fix and a major overhaul of your code. Dave, can you explain a bit on what are you trying to say and how and what factors to look for in the code. Thanks & Regards,

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                Simple. Either you don't have a valid primary key (for example, the VIN is unique to each car, but you should never use it as a primary key) or your code is generating the key values (REALLY bad idea!). In order to fix this you are either going to have to add proper primary keys to your tables, and update your code accordingly or you're going to have to add a layer to your database where every instance of your app is going to have to go through a singleton running on a server to have a primary key generated. Only one instance of your app is going to be able to call this singleton at a time which is going to kill your scalability. Oh, and you're still going to have to update your code to support this.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak

                A 1 Reply Last reply
                0
                • D Dave Kreskowiak

                  Simple. Either you don't have a valid primary key (for example, the VIN is unique to each car, but you should never use it as a primary key) or your code is generating the key values (REALLY bad idea!). In order to fix this you are either going to have to add proper primary keys to your tables, and update your code accordingly or you're going to have to add a layer to your database where every instance of your app is going to have to go through a singleton running on a server to have a primary key generated. Only one instance of your app is going to be able to call this singleton at a time which is going to kill your scalability. Oh, and you're still going to have to update your code to support this.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak

                  A Offline
                  A Offline
                  All Time Programming
                  wrote on last edited by
                  #8

                  Thanks Dave for clean and clear explaination and how should I handle this. Thanks & Regards,

                  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