Deleted row (Primary key) on the server causes conflict when client adds new record
See original GitHub issueHi - Iam using dotmim to sync a sqlite client with a sql server database. When I delete a row in management studio. A cannot add any records from the client in the same table (upload 1, conflict 1). I am guessing there is a primary key conflict, as the primary key that the client is trying to use is not acceptable to sql server. Is there a simple fix? Can I set sql server to reseed? or are UniqueIdentifiers/Guids the way forward? Thanks in advance - Pete ` var serverProvider = new SqlSyncChangeTrackingProvider(@“connectionstring;”);
var clientProvider = new SqliteSyncProvider("Record.db3");
var agent = new SyncAgent(clientProvider, serverProvider, new string[] { "Answer", "Question", "Response",
"ResponseType", "Site" });
var syncContext = await agent.SynchronizeAsync(SyncType.ReinitializeWithUpload);`
Issue Analytics
- State:
- Created a year ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Managing Identity Columns as Primary Keys in DMS. ...
Client inserts a new record : Primary Key generated : 42; Server inserts a ... Deleted row (Primary key) on the server causes...
Read more >How Siebel Remote Resolves Conflicts in Data It ...
If the user primary key of a new row matches the user primary key of an existing row, then Siebel Remote determines that...
Read more >Access linked table to SQL Server database returns Deleted
When you try to commit record changes to the linked table, you may also receive the following "Write Conflict" message:.
Read more >Locking issue with concurrent DELETE / INSERT in ...
When a READ COMMITTED transaction awakens from a block on a write conflict, it follows that update chain to the end; if the...
Read more >Auto Increment after delete in MySQL
This record becomes orphaned from the first table. If a new record is inserted into the first table, and a sequential primary key...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

We use integer primary keys as below. This is adequate for many use cases (Google/Facebook wouldn’t do it this way).
It will usually result in less fragmentation, less disk space, faster CRUD on the server than guids/uuids.
I welcome constructive critique
For the moment iam using int i = Guid.NewGuid().GetHashCode();