I am trying to execute a tool I wrote in C# .NET 4 using the DFC 6.5/6.7 libraries. I have about 900,000 records where I simply want to retrieve the file, do some analysis and move on.
Here's the area of my code where I'm having a problem. I had originally had the client and SessionManager outside of the loop, with no difference. I've tried calling the cache clearing and release session in every loop - no difference.
The documentation is lousy for C# and also preventing Java Heap Out Of Memory errors and how to release properly from C#.
Anyone have solid experience suggestions (don't tell me to Google - its results are worthless)
while (looping on set of 900,000 records) // NOT REAL LOOP STRUCTURE BUT HERE FOR CONTEXT
{
client = clientX.getLocalClient();
var config = client.getClientConfig();
loginInfo = clientX.getLoginInfo();
loginInfo.setUser(dctmUsername);
loginInfo.setPassword(dctmPassword);
loginInfo.setDomain("");
sessionManager = client.newSessionManager();
sessionManager.setIdentity(docBase, loginInfo);
session = sessionManager.getSession(docBase);
IDfSysObject dctmObject;
var attributes = new Dictionary<string, string>();
string dql = string.Format( "fpl_nams_record where d_code = '{0}'", dcode);
dctmObject = ((IDfSysObject) session.getObjectByQualification(dql));
int attrCount = dctmObject.getAttrCount();
for (int ai = 0; ai < attrCount; ai++)
{
try
{
var attr = dctmObject.getAttr(ai);
string attrName = attr.getName();
var value = dctmObject.getValue(attrName);
attributes.Add(attrName, value.asString());
attr = null;
}
catch (Exception ex)
{
Debug.Print("Exception while getting attribute: " + ex);
}
}
dctmObject.getFileEx(filePath, "pdf", 0, false);
} // end of loop