VB.NET Handle SQL DB in Multi user application
-
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,
-
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,
Use identity columns so that the ID's are generated automatically.
-
Use identity columns so that the ID's are generated automatically.
Thanks AspDotNetDev, Its a high-end reqd to generate ID programmatically and not auto. Thanks & Regards,
-
Thanks AspDotNetDev, Its a high-end reqd to generate ID programmatically and not auto. Thanks & Regards,
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?
-
Thanks AspDotNetDev, Its a high-end reqd to generate ID programmatically and not auto. Thanks & Regards,
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 -
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 KreskowiakThanks 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,
-
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,
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 -
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 KreskowiakThanks Dave for clean and clear explaination and how should I handle this. Thanks & Regards,