Add separate counts for Errors, Warnings and Information

Cleanup memory after transition processing
Adjusted width of Error Count
Added memory usage to output
Added Stored Procedure GetJustFormat
Reduce Memory Use
Removed extra using statement
This commit is contained in:
Rich
2012-05-21 13:30:21 +00:00
parent 508a86a8ac
commit f5544b7053
9 changed files with 117 additions and 37 deletions

View File

@@ -41,7 +41,9 @@ namespace DataLoader
ProcFileName = dr["Entry"].ToString();
ProcNumber = dr["Number"].ToString();
frmMain.Status = "Processing Procedure " + ProcNumber + " - " + ProcFileName;
GC.Collect();
frmMain.AddInfo("Processing Procedure {0} {1}", ProcNumber, GC.GetTotalMemory(true));
//frmMain.MyInfo = CSLACache.UsageNotFinalized;
DateTime dts = GetDTS(dr["Date"].ToString(), dr["Time"].ToString());
@@ -223,7 +225,6 @@ namespace DataLoader
frmMain.AddError(ex, "MigrateProcedure - {0}", ProcFileName);
}
da.Dispose();
// dicSecCount is dictionary to track number of subsections for the parent at a level
// dicSecID is the parent at that level
Dictionary<int, int> dicSecCount = new Dictionary<int, int>();
@@ -286,6 +287,8 @@ namespace DataLoader
}
}
dv.Dispose();
//foreach (Item secItm in dicSecParentItem.Values)
// secItm.Dispose();
// need section start
if (EditSectId != 0)
{
@@ -378,8 +381,22 @@ namespace DataLoader
{
if (OKtoProcessDBF(dr)) // look for duplicate SET file info - jsj 2/11/10
{
List<int> cacheContentInfo = ContentInfo.CacheList;
List<int> cacheItemInfo = ItemInfo.CacheList;
List<int> cacheEntryInfo = EntryInfo.CacheList;
List<int> cachePdfInfo = PdfInfo.CacheList;
List<int> cacheDocVersionInfo = DocVersionInfo.CacheList;
List<int> cachePartInfo = PartInfo.CacheList;
FrItm = MigrateProcedure(cn, dr, FrItm, pth, docver, convertProcedures, activeFormat);
if (FirstItm == null) FirstItm = FrItm;
frmMain.MyInfo = string.Format("Before Restore {0}", GC.GetTotalMemory(true));
ContentInfo.RestoreCacheList(cacheContentInfo);
PartInfo.RestoreCacheList(cachePartInfo);
ItemInfo.RestoreCacheList(cacheItemInfo);
EntryInfo.RestoreCacheList(cacheEntryInfo);
PdfInfo.RestoreCacheList(cachePdfInfo);
DocVersionInfo.RestoreCacheList(cacheDocVersionInfo);
frmMain.MyInfo = string.Format("After Restore {0}", GC.GetTotalMemory(true));
}
}
//GC.Collect();
@@ -391,6 +408,10 @@ namespace DataLoader
_MyLog.ErrorFormat("MigrateProcedures - {0} - {1}\r\n\r\n{2}", pth,ex.Message, ex.InnerException);
//throw new Exception("Error in MigrateProcedures: " + pth, ex);
}
frmMain.MyInfo = CSLACache.UsageAll;
frmMain.AddInfo(Content.MyStack);
frmMain.AddInfo(ContentInfo.MyStack);
frmMain.AddInfo(DocVersionInfo.MyStack);
return FirstItm;
}
private void DbtOk(string fname, string pth)