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

Sample fails with error #1114

Closed
420tech opened this issue Oct 13, 2023 · 1 comment
Closed

Sample fails with error #1114

420tech opened this issue Oct 13, 2023 · 1 comment

Comments

@420tech
Copy link

420tech commented Oct 13, 2023

I tried the tutorial as described and got this error:
Dotmim.Sync.SyncException
HResult=0x80131500
Message=[InternalApplyChangesAsync]..Error on table [ProductCategory]: SQLite Error 19: 'FOREIGN KEY constraint failed'.. Row:[Sync state]:ApplyModifiedFailed, [ProductCategoryID]:7c782bbe-5a16-495a-aa50-10afe5a84af2, [ParentProductCategoryID]:c657828d-d808-4aba-91a3-af2ce02300e9, [Name]:Headsets, [rowguid]:5de142e8-f2a5-4009-a455-f32714407a83, [ModifiedDate]:6/1/2002 12:00:00 AM, [IsActive]:True. ApplyType:Modified
Source=Dotmim.Sync.Core
StackTrace:
at Dotmim.Sync.SyncAgent.d__28.MoveNext()
at Dotmim.Sync.SyncAgent.d__28.MoveNext()
at Program.<

$>d__0.MoveNext() in C:\Users\timbe\source\repos\TestDotMim\TestDotMim\Program.cs:line 24

This exception was originally thrown at this call stack:
[External Code]

Inner Exception 1:
ApplyChangesException: Error on table [ProductCategory]: SQLite Error 19: 'FOREIGN KEY constraint failed'.. Row:[Sync state]:ApplyModifiedFailed, [ProductCategoryID]:7c782bbe-5a16-495a-aa50-10afe5a84af2, [ParentProductCategoryID]:c657828d-d808-4aba-91a3-af2ce02300e9, [Name]:Headsets, [rowguid]:5de142e8-f2a5-4009-a455-f32714407a83, [ModifiedDate]:6/1/2002 12:00:00 AM, [IsActive]:True. ApplyType:Modified

Inner Exception 2:
SqliteException: SQLite Error 19: 'FOREIGN KEY constraint failed'.

@Mimetis
Copy link
Owner

Mimetis commented Oct 15, 2023

try with DisableConstraintsOnApplyChanges

var options = new SyncOptions { DisableConstraintsOnApplyChanges = true }

// Sync agent
SyncAgent agent = new SyncAgent(clientProvider, serverProvider, options);

@Mimetis Mimetis closed this as completed Oct 15, 2023
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

2 participants