Mac
Mac

Reputation: 53

Distributed App - Single user updating the database?

I have an app that will be used by up 22 users at one time, that pulls data from an API. in the background the app also copies some of the data into a SQL Database, but I am running into the problem of getting duplicate records because more than one application tries to update the database at the same time.

I have tried using "TimeStamp" in a different table to see when the database was last updated, but that doesn't account for on-going New updates.

back in Microsoft Access world I would use "SeeDatabaseChanges" to prevent records getting duplicated, but is there a way to make sure that only 1 app instance updates the database or better runs the method?

Thanks in advance

Upvotes: 0

Views: 98

Answers (1)

Cahaba Data
Cahaba Data

Reputation: 622

just at a high level: to avoid duplicates - one must define duplicate and check for it before the append/write.

check for dupe may not be trivial; Is it last name, first name or does it need to be every field of the address - or is it even more fields...etc etc...

so there may be some side processing in an import staging temp table to hold new data for the purpose of determining duplicates, and then a final step to append/insert just new records into the permanent table...

the actual implementation is very dependent on how your app actually works and the actual data involved....

Upvotes: 1

Related Questions