In sql how to always insert data in a table with concurrency? Must ensure that the data is received, example table “Bet”, all the app clients of that database server must have de ensure that their bet is placed.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
On an INSERT statement, the only way to not have concurrency is to violate some kind of constraint. As long as you have declared the constraint (primary key, not null, foreign key, etc), the database will throw an error on any violation.
I’m not sure what API you are using to talk to the database, but it will certainly signal in some way that a database error has occurred. Then you need to handle that case appropriately by informing the application to invalidate the data.