Process recalc and fix for "not good" rowcount not displayed

This commit is contained in:
Christian Wade 2020-06-12 23:13:43 -07:00
parent 4be8c9b8a3
commit bc3191350e
5 changed files with 152 additions and 108 deletions

View File

@ -531,10 +531,11 @@ namespace BismNormalizer.TabularCompare.Core
foreach (XmlNode childNode in row.ChildNodes)
{
if (childNode.Name.Contains("RowCount"))
{
//cbw not good:
//if (childNode.Name.Contains("RowCount"))
//{
rowCountNode = childNode;
}
//}
}
int result;

View File

@ -29,7 +29,7 @@ namespace BismNormalizer.TabularCompare
/// <summary>
/// Processing option for database deployment.
/// </summary>
public enum ProcessingOption { Default, DoNotProcess, Full };
public enum ProcessingOption { Recalc, Default, DoNotProcess, Full };
/// <summary>
/// Status of database deployment.

View File

@ -2208,12 +2208,31 @@ namespace BismNormalizer.TabularCompare.TabularMetadata
try
{
_stopProcessing = false;
RefreshType refreshType = _comparisonInfo.OptionsInfo.OptionProcessingOption == ProcessingOption.Default ? RefreshType.Automatic : RefreshType.Full;
RefreshType refreshType = RefreshType.Calculate;
switch (_comparisonInfo.OptionsInfo.OptionProcessingOption)
{
//case ProcessingOption.Recalc:
// refreshType = RefreshType.Calculate;
// break;
case ProcessingOption.Default:
refreshType = RefreshType.Automatic;
break;
//case ProcessingOption.DoNotProcess:
// break;
case ProcessingOption.Full:
refreshType = RefreshType.Full;
break;
default:
break;
}
TraceEvent traceEvent = null;
if (refreshType != RefreshType.Calculate)
{
//Set up server trace to capture how many rows processed
_sessionId = _server.SessionID;
trace = _server.Traces.Add();
TraceEvent traceEvent = trace.Events.Add(Amo.TraceEventClass.ProgressReportCurrent);
traceEvent = trace.Events.Add(Amo.TraceEventClass.ProgressReportCurrent);
traceEvent.Columns.Add(Amo.TraceColumn.ObjectID);
traceEvent.Columns.Add(Amo.TraceColumn.ObjectName);
traceEvent.Columns.Add(Amo.TraceColumn.ObjectReference);
@ -2235,11 +2254,14 @@ namespace BismNormalizer.TabularCompare.TabularMetadata
}
}
}
}
//Need recalc even if created no tables in case of new relationships without tables
_database.Model.RequestRefresh(RefreshType.Calculate);
_database.Model.SaveChanges();
if (refreshType != RefreshType.Calculate)
{
// Show row count for each table
foreach (ProcessingTable table in _tablesToProcess)
{
@ -2258,6 +2280,12 @@ namespace BismNormalizer.TabularCompare.TabularMetadata
}
_parentComparison.OnDeploymentMessage(new DeploymentMessageEventArgs(table.Name, message, DeploymentStatus.Success));
}
}
else
{
_parentComparison.OnDeploymentMessage(new DeploymentMessageEventArgs(_database.Name, "Success. Process recalc done.", DeploymentStatus.Success));
}
_parentComparison.OnDeploymentComplete(new DeploymentCompleteEventArgs(DeploymentStatus.Success, null));
}
//catch (InvalidOperationException exc) when (exc.Message == "Operation is not valid due to the current state of the object.")
@ -2271,10 +2299,13 @@ namespace BismNormalizer.TabularCompare.TabularMetadata
finally
{
try
{
if (trace != null)
{
trace.Stop();
trace.Drop();
}
}
catch { }
}
}

View File

@ -64,11 +64,22 @@ namespace BismNormalizer.TabularCompare.UI
btnClose.Enabled = false;
_errorMessageForm = new ProcessingErrorMessage();
ProcessingTableCollection tablesToProcess = _comparison.GetTablesToProcess();
ProcessingTableCollection tablesToProcess = null;
if (_comparisonInfo.OptionsInfo.OptionProcessingOption == ProcessingOption.Recalc)
{
string dbName = _comparisonInfo.ConnectionInfoTarget.DatabaseName;
tablesToProcess = new ProcessingTableCollection();
tablesToProcess.Add(new ProcessingTable(dbName, dbName));
AddRow(dbName, "Processing in progress ...");
}
else
{
tablesToProcess = _comparison.GetTablesToProcess();
foreach (ProcessingTable table in tablesToProcess)
{
AddRow(table.Name, "Processing in progress ...");
}
}
if (tablesToProcess.Count > 0)
{
btnStopProcessing.Enabled = true;

View File

@ -35,6 +35,7 @@
this.chkMeasureDependencies = new System.Windows.Forms.CheckBox();
this.chkPerspectives = new System.Windows.Forms.CheckBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.chkRetainStorageMode = new System.Windows.Forms.CheckBox();
this.chkRetainPolicyPartitions = new System.Windows.Forms.CheckBox();
this.chkRetainPartitions = new System.Windows.Forms.CheckBox();
this.chkMergeCultures = new System.Windows.Forms.CheckBox();
@ -44,7 +45,6 @@
this.chkAffectedTables = new System.Windows.Forms.CheckBox();
this.cboProcessingOption = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.chkRetainStorageMode = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
@ -53,10 +53,10 @@
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(411, 673);
this.btnCancel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.btnCancel.Location = new System.Drawing.Point(365, 538);
this.btnCancel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(112, 35);
this.btnCancel.Size = new System.Drawing.Size(100, 28);
this.btnCancel.TabIndex = 21;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
@ -65,10 +65,10 @@
//
this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOK.Location = new System.Drawing.Point(290, 673);
this.btnOK.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.btnOK.Location = new System.Drawing.Point(258, 538);
this.btnOK.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(112, 35);
this.btnOK.Size = new System.Drawing.Size(100, 28);
this.btnOK.TabIndex = 20;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
@ -79,10 +79,10 @@
this.chkRoles.AutoSize = true;
this.chkRoles.Checked = true;
this.chkRoles.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkRoles.Location = new System.Drawing.Point(20, 186);
this.chkRoles.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.chkRoles.Location = new System.Drawing.Point(18, 149);
this.chkRoles.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chkRoles.Name = "chkRoles";
this.chkRoles.Size = new System.Drawing.Size(118, 24);
this.chkRoles.Size = new System.Drawing.Size(103, 20);
this.chkRoles.TabIndex = 5;
this.chkRoles.Text = "Include roles";
this.chkRoles.UseVisualStyleBackColor = true;
@ -90,10 +90,10 @@
// chkPartitions
//
this.chkPartitions.AutoSize = true;
this.chkPartitions.Location = new System.Drawing.Point(20, 232);
this.chkPartitions.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.chkPartitions.Location = new System.Drawing.Point(18, 186);
this.chkPartitions.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chkPartitions.Name = "chkPartitions";
this.chkPartitions.Size = new System.Drawing.Size(327, 24);
this.chkPartitions.Size = new System.Drawing.Size(279, 20);
this.chkPartitions.TabIndex = 6;
this.chkPartitions.Text = "Consider partitions when comparing tables";
this.chkPartitions.UseVisualStyleBackColor = true;
@ -105,10 +105,10 @@
this.chkMeasureDependencies.AutoSize = true;
this.chkMeasureDependencies.Checked = true;
this.chkMeasureDependencies.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkMeasureDependencies.Location = new System.Drawing.Point(20, 397);
this.chkMeasureDependencies.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.chkMeasureDependencies.Location = new System.Drawing.Point(18, 318);
this.chkMeasureDependencies.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chkMeasureDependencies.Name = "chkMeasureDependencies";
this.chkMeasureDependencies.Size = new System.Drawing.Size(61, 24);
this.chkMeasureDependencies.Size = new System.Drawing.Size(51, 20);
this.chkMeasureDependencies.TabIndex = 7;
this.chkMeasureDependencies.Text = "XXX";
this.chkMeasureDependencies.UseVisualStyleBackColor = true;
@ -116,10 +116,10 @@
// chkPerspectives
//
this.chkPerspectives.AutoSize = true;
this.chkPerspectives.Location = new System.Drawing.Point(20, 38);
this.chkPerspectives.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.chkPerspectives.Location = new System.Drawing.Point(18, 30);
this.chkPerspectives.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chkPerspectives.Name = "chkPerspectives";
this.chkPerspectives.Size = new System.Drawing.Size(173, 24);
this.chkPerspectives.Size = new System.Drawing.Size(151, 20);
this.chkPerspectives.TabIndex = 3;
this.chkPerspectives.Text = "Include perspectives";
this.chkPerspectives.UseVisualStyleBackColor = true;
@ -140,23 +140,34 @@
this.groupBox1.Controls.Add(this.chkMeasureDependencies);
this.groupBox1.Controls.Add(this.chkPartitions);
this.groupBox1.Controls.Add(this.chkRoles);
this.groupBox1.Location = new System.Drawing.Point(18, 18);
this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.groupBox1.Location = new System.Drawing.Point(16, 14);
this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.groupBox1.Size = new System.Drawing.Size(506, 471);
this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupBox1.Size = new System.Drawing.Size(450, 377);
this.groupBox1.TabIndex = 22;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Comparison Options";
//
// chkRetainStorageMode
//
this.chkRetainStorageMode.AutoSize = true;
this.chkRetainStorageMode.Location = new System.Drawing.Point(18, 286);
this.chkRetainStorageMode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chkRetainStorageMode.Name = "chkRetainStorageMode";
this.chkRetainStorageMode.Size = new System.Drawing.Size(258, 20);
this.chkRetainStorageMode.TabIndex = 12;
this.chkRetainStorageMode.Text = "For table updates, retain storage mode";
this.chkRetainStorageMode.UseVisualStyleBackColor = true;
//
// chkRetainPolicyPartitions
//
this.chkRetainPolicyPartitions.AutoSize = true;
this.chkRetainPolicyPartitions.Enabled = false;
this.chkRetainPolicyPartitions.Location = new System.Drawing.Point(52, 312);
this.chkRetainPolicyPartitions.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.chkRetainPolicyPartitions.Location = new System.Drawing.Point(46, 250);
this.chkRetainPolicyPartitions.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chkRetainPolicyPartitions.Name = "chkRetainPolicyPartitions";
this.chkRetainPolicyPartitions.Size = new System.Drawing.Size(322, 24);
this.chkRetainPolicyPartitions.Size = new System.Drawing.Size(277, 20);
this.chkRetainPolicyPartitions.TabIndex = 11;
this.chkRetainPolicyPartitions.Text = "Retain only refresh-policy based partitions";
this.chkRetainPolicyPartitions.UseVisualStyleBackColor = true;
@ -164,10 +175,10 @@
// chkRetainPartitions
//
this.chkRetainPartitions.AutoSize = true;
this.chkRetainPartitions.Location = new System.Drawing.Point(20, 280);
this.chkRetainPartitions.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.chkRetainPartitions.Location = new System.Drawing.Point(18, 224);
this.chkRetainPartitions.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chkRetainPartitions.Name = "chkRetainPartitions";
this.chkRetainPartitions.Size = new System.Drawing.Size(270, 24);
this.chkRetainPartitions.Size = new System.Drawing.Size(228, 20);
this.chkRetainPartitions.TabIndex = 10;
this.chkRetainPartitions.Text = "For table updates, retain partitions";
this.chkRetainPartitions.UseVisualStyleBackColor = true;
@ -177,10 +188,10 @@
//
this.chkMergeCultures.AutoSize = true;
this.chkMergeCultures.Enabled = false;
this.chkMergeCultures.Location = new System.Drawing.Point(52, 148);
this.chkMergeCultures.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.chkMergeCultures.Location = new System.Drawing.Point(46, 118);
this.chkMergeCultures.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chkMergeCultures.Name = "chkMergeCultures";
this.chkMergeCultures.Size = new System.Drawing.Size(398, 24);
this.chkMergeCultures.Size = new System.Drawing.Size(335, 20);
this.chkMergeCultures.TabIndex = 9;
this.chkMergeCultures.Text = "For culture updates, merge translations (not replace)";
this.chkMergeCultures.UseVisualStyleBackColor = true;
@ -188,10 +199,10 @@
// chkCultures
//
this.chkCultures.AutoSize = true;
this.chkCultures.Location = new System.Drawing.Point(20, 115);
this.chkCultures.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.chkCultures.Location = new System.Drawing.Point(18, 92);
this.chkCultures.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chkCultures.Name = "chkCultures";
this.chkCultures.Size = new System.Drawing.Size(140, 24);
this.chkCultures.Size = new System.Drawing.Size(119, 20);
this.chkCultures.TabIndex = 8;
this.chkCultures.Text = "Include cultures";
this.chkCultures.UseVisualStyleBackColor = true;
@ -201,10 +212,10 @@
//
this.chkMergePerspectives.AutoSize = true;
this.chkMergePerspectives.Enabled = false;
this.chkMergePerspectives.Location = new System.Drawing.Point(52, 71);
this.chkMergePerspectives.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.chkMergePerspectives.Location = new System.Drawing.Point(46, 57);
this.chkMergePerspectives.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chkMergePerspectives.Name = "chkMergePerspectives";
this.chkMergePerspectives.Size = new System.Drawing.Size(420, 24);
this.chkMergePerspectives.Size = new System.Drawing.Size(360, 20);
this.chkMergePerspectives.TabIndex = 4;
this.chkMergePerspectives.Text = "For perspective updates, merge selections (not replace)";
this.chkMergePerspectives.UseVisualStyleBackColor = true;
@ -216,11 +227,11 @@
this.groupBox2.Controls.Add(this.chkAffectedTables);
this.groupBox2.Controls.Add(this.cboProcessingOption);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Location = new System.Drawing.Point(18, 499);
this.groupBox2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.groupBox2.Location = new System.Drawing.Point(16, 399);
this.groupBox2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.groupBox2.Size = new System.Drawing.Size(506, 155);
this.groupBox2.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupBox2.Size = new System.Drawing.Size(450, 124);
this.groupBox2.TabIndex = 23;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Database Deployment";
@ -230,10 +241,10 @@
this.chkAffectedTables.AutoSize = true;
this.chkAffectedTables.Checked = true;
this.chkAffectedTables.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkAffectedTables.Location = new System.Drawing.Point(20, 98);
this.chkAffectedTables.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.chkAffectedTables.Location = new System.Drawing.Point(18, 78);
this.chkAffectedTables.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chkAffectedTables.Name = "chkAffectedTables";
this.chkAffectedTables.Size = new System.Drawing.Size(227, 24);
this.chkAffectedTables.Size = new System.Drawing.Size(196, 20);
this.chkAffectedTables.TabIndex = 9;
this.chkAffectedTables.Text = "Process only affected tables";
this.chkAffectedTables.UseVisualStyleBackColor = true;
@ -244,49 +255,39 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.cboProcessingOption.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboProcessingOption.Items.AddRange(new object[] {
"Recalc",
"Default",
"Do Not Process",
"Full"});
this.cboProcessingOption.Location = new System.Drawing.Point(171, 38);
this.cboProcessingOption.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.cboProcessingOption.Location = new System.Drawing.Point(152, 30);
this.cboProcessingOption.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.cboProcessingOption.Name = "cboProcessingOption";
this.cboProcessingOption.Size = new System.Drawing.Size(194, 28);
this.cboProcessingOption.Size = new System.Drawing.Size(173, 24);
this.cboProcessingOption.TabIndex = 8;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(18, 43);
this.label1.Location = new System.Drawing.Point(16, 34);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(142, 20);
this.label1.Size = new System.Drawing.Size(121, 16);
this.label1.TabIndex = 0;
this.label1.Text = "Processing Option:";
//
// chkRetainStorageMode
//
this.chkRetainStorageMode.AutoSize = true;
this.chkRetainStorageMode.Location = new System.Drawing.Point(20, 357);
this.chkRetainStorageMode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.chkRetainStorageMode.Name = "chkRetainStorageMode";
this.chkRetainStorageMode.Size = new System.Drawing.Size(303, 24);
this.chkRetainStorageMode.TabIndex = 12;
this.chkRetainStorageMode.Text = "For table updates, retain storage mode";
this.chkRetainStorageMode.UseVisualStyleBackColor = true;
//
// Options
//
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(542, 733);
this.ClientSize = new System.Drawing.Size(482, 586);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Options";