public static void UpdateActivity(IndexingActivity activity) { using (var context = new IndexingDataContext()) { context.CommandTimeout = RepositoryConfiguration.SqlCommandTimeout; context.IndexingActivities.Attach(activity, true); context.SubmitChanges(); } }
public static void RegisterActivity(IndexingActivity activity) { using (var context = new IndexingDataContext()) { context.CommandTimeout = RepositoryConfiguration.SqlCommandTimeout; context.IndexingActivities.InsertOnSubmit(activity); context.SubmitChanges(); } }
[Description("An activity execution with update activity after delete activity not throws any exception.")] // ?? public void Indexing_ActivitesWithMissingVersion() { var content = Content.CreateNew("Car", TestRoot, "Car_Indexing_ActivitesWithMissingVersion"); var handler = (GenericContent)content.ContentHandler; //handler.VersioningMode = VersioningType.None; content.Save(); var id = content.Id; LuceneManager.ApplyChanges(); IndexingActivity[] act = new IndexingActivity[3]; act[0] = new IndexingActivity { ActivityType = IndexingActivityType.RemoveDocument, NodeId = _fakeId, VersionId = _fakeId }; act[1] = new IndexingActivity { ActivityType = IndexingActivityType.UpdateDocument, NodeId = _fakeId, VersionId = _fakeId }; act[2] = new IndexingActivity { ActivityType = IndexingActivityType.AddDocument, NodeId = _fakeId, VersionId = _fakeId }; try { using (var context = new IndexingDataContext()) { foreach (var a in act) { context.IndexingActivities.InsertOnSubmit(a); context.SubmitChanges(); } } var max = 0; var activities = IndexingActivityManager.GetUnprocessedActivities(act[2].IndexingActivityId - 1, out max); foreach (var a in activities) IndexingActivityManager.ExecuteActivityDirect(a); } finally { RemoveFakeTestActivity(); } }