Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
reset abortedChangelog when no transactions are commited (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarle Pedersen authored May 20, 2019
1 parent 1b57760 commit 51adb85
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CORESubscriber/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,17 @@ private static void SynchronizeSubscribedDatasets()
{
datasetsFailed.Add(Dataset.GetDatasetIdFromElement(subscribedElement));

if (Dataset.GetTransaction() == 0)
{
Dataset.ResetAbortedChangelog();

Dataset.SetOrderedChangelogId("0");
}
else
{
Console.WriteLine($"WARNING: Dataset with id {datasetsFailed.Last()} is left in unknown state due to partial commits of transactions. The subscriber will keep trying to commit the active changelog, but no longer knows which changeId it is currently at. If this problem persists you need to empty the database and synchronize this dataset from scratch.");
}

HandleExceptionText(e);
}
}
Expand Down

0 comments on commit 51adb85

Please sign in to comment.