Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict Issue while using GUID as Primary Keys #1118

Closed
hsharma89 opened this issue Oct 18, 2023 · 2 comments
Closed

Conflict Issue while using GUID as Primary Keys #1118

hsharma89 opened this issue Oct 18, 2023 · 2 comments

Comments

@hsharma89
Copy link

hsharma89 commented Oct 18, 2023

Hi Sébastien Pertus,
We are facing a weird situation regarding conflicts.
Issue: I have 2 applications 1 website Connected with SQL Server Main Database and 1 desktop app connected with Sqlite Database.

Whenever I modify any row using my website and try to sync data using the Desktop application, the Modified data is not syncing to the local SQLite Database.
This issue is mostly happening on the tables where I have used GUID as the Primary Key.
I have created a console application to check the issue, agent.LocalOrchestrator.OnApplyChangesConflictOccured shows that there is a conflict. (This is not a conflict as data is only modified using the server not from the client).
Conflict Scenario as per your documentation: Conflicts occurs when a client update / delete/insert a record that is updated/deleted or inserted on the server as well before any sync happens.

I have found that Dotmim has Automatically resolved the conflict but changes are not applied to the client.
See the Below screenshot.
image
However, if I use the following code:

agent.LocalOrchestrator.OnApplyChangesConflictOccured(args =>
{
       args.Resolution = ConflictResolution.MergeRow;
});

It will apply changes to the client. My question is this a good approach?
image

More Information:
I am using ConflictResolutionPolicy.ClientWins
Dotmim Version: 0.9.7.

One Other Question: Can we use the same user for desktop clients on different machines?

@Mimetis
Copy link
Owner

Mimetis commented Oct 18, 2023

Can you try with the last beta version and see if the result is the same ?

@symbiogenesis
Copy link
Contributor

I had a problem with this and switched my primary keys to use ULID via NUlid

@Mimetis Mimetis closed this as completed Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants