-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Cant sync deleted record on server #965
Comments
Are you using a |
Can you share the code you are using, and a simple script to create your table on the server |
Our scenario is a little complex, but we found out that this problem occurs even if we reduce it to a simple delete directly on SQL Server, behind the web orchestrator. |
I need a sample Github repository where you are able to reproduce the error, using the simplest setup as possible. |
Here is my sample, if you want to use it as a template I'm using this script https://github.com/Mimetis/Dotmim.Sync/blob/master/CreateAdventureWorks.sql as server database // Using the Progress pattern to handle progression during the synchronization
var progress = new SynchronousProgress<ProgressArgs>(s =>
Console.WriteLine($"{s.ProgressPercentage:p}: " +
$"\t[{s?.Source[..Math.Min(4, s.Source.Length)]}] " +
$"{s.TypeName}: {s.Message}"));
// Server provider
var serverProvider = new SqlSyncProvider(DBHelper.GetDatabaseConnectionString(serverDbName));
// Clients 1 & 2 providers
var clientProvider1 = new SqliteSyncProvider(
Path.GetRandomFileName().Replace(".", "").ToLowerInvariant() + ".db");
var clientProvider2 = new SqliteSyncProvider(
Path.GetRandomFileName().Replace(".", "").ToLowerInvariant() + ".db");
var options = new SyncOptions { DisableConstraintsOnApplyChanges = true };
var setup = new SyncSetup("ProductCategory");
try
{
var agent1 = new SyncAgent(clientProvider1, serverProvider, options);
var agent2 = new SyncAgent(clientProvider2, serverProvider, options);
// Sync client 1 to create table and gell all product categories
var result1 = await agent1.SynchronizeAsync(setup, progress: progress);
Console.WriteLine(result1);
// Total changes uploaded: 0
// Total changes downloaded: 42
// Total changes applied on client: 42
// Sync client 2 to create table and get all product categories
var result2 = await agent2.SynchronizeAsync(setup, progress: progress);
Console.WriteLine(result2);
// Total changes uploaded: 0
// Total changes downloaded: 42
// Total changes applied on client: 42
// Add a product category on server
var productCategoryId = await DBHelper.AddProductCategoryRowAsync(serverProvider);
// Sync client 1 to get this new created server product category on client 1
result1 = await agent1.SynchronizeAsync(setup, progress: progress);
Console.WriteLine(result1);
// Total changes uploaded: 0
// Total changes downloaded: 1
// Total changes applied on client: 1
// Sync client 2 to get this new created server product category on client 2
result2 = await agent2.SynchronizeAsync(setup, progress: progress);
Console.WriteLine(result2);
// Total changes uploaded: 0
// Total changes downloaded: 1
// Total changes applied on client: 1
// Now delete server product category
await DBHelper.DeleteProductCategoryRowAsync(serverProvider, productCategoryId);
// Sync client 1 to sync the deleted product category from server
result1 = await agent1.SynchronizeAsync(setup, progress: progress);
Console.WriteLine(result1);
// Total changes uploaded: 0
// Total changes downloaded: 1
// Total changes applied on client: 1
// Sync client 1 to sync the deleted product category from server
result2 = await agent2.SynchronizeAsync(setup, progress: progress);
Console.WriteLine(result2);
// Total changes uploaded: 0
// Total changes downloaded: 1
// Total changes applied on client: 1
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
Console.WriteLine("Sync Ended. Press a key to start again, or Escapte to end");
|
The problem was on SyncFilter. Just a simple change from "Join.Inner" to "Join.Left" and it syncs deleted records. |
Hi there,
I have the following issue, using a bidirectional scope when I delete a record on my client (SQLite) and sync the databases, the record is not removed in the server(MSSQLS). How can I solve this issue?
edit: I'm currently using the latest version.
The text was updated successfully, but these errors were encountered: