cancel
Showing results for 
Search instead for 
Did you mean: 

App Server Timeout During Exports

Rob_Balyeat
Champ in-the-making
Champ in-the-making

OnBase v9.2.1.67 (Unity API)

Hello,

With a List<long> of document handles, I wish to export those documents. The ones in question happen to be SYS Import Indexes, about 1300. The following is a snippet of code which will fail after various number of iterations. The application server simply times out. Nothing of interest is logged in Diagnostic Console. The application pool servicing the App Server can be recycled, the code restarted, and the export will fail after a different number of exports... sometimes after 200, other times after a 1000. The failure appears under five minutes, usually between 2-3 minutes. Any ideas?

4 REPLIES 4

Timothy_Cosgrif
Star Collaborator
Star Collaborator

Does this happen every time you run this piece of code? Also, are the document ID's you are retrieving all of type SYS Import Indexes? If they are, is there a reason you are doing it this way as opposed to running a document query and iterating through that?

Rob_Balyeat
Champ in-the-making
Champ in-the-making

It does in fact happen every time, and all the document IDs are of type SYS Import Indexes. If I put the thread to sleep for a second between iterations of the doc IDs it seems to do better, but still does not finish executing.

Since I was only really after a cople of fields within the SYS Import Indexes document, I ended up simply parsing the file and writing out what I needed within the loop (as opposed to using Utility.WriteStremToFile). This seemed to do the trick... but I still have no idea why this isn't working.

By the way, the reason I retrieved using docIDs in this fashion instead of a standard document query... had to do with the fact that I had a handful of DIP batch numbers and it seemed easier to just query SQL directly.

 

Nick_Askew
Champ in-the-making
Champ in-the-making

Try setting Document to nothing before the loop starts again and then place this code after you Document=Nothing call:

GC.Collect()

GC.WaitForPendingFinalizers()

If this makes it stable then the issue was to do with garbage collecting the Document object, something that would happen when you manually pause between each iteration of the loop.

Cheers

Nick

Patrick_Ramser
Star Contributor
Star Contributor

Also, is an error even returned to the Client or does it specifically just mention that your "Request timed out"? Seeing what the Unity client code is doing through a Stack Trace would be another jumping off point for determining what's going on.

To narrow it down even further, while it might not be a quick test, you could test the same code against a 'DocumentList' from a DocumentQuery that returns everything in SYS - Import Indexes without the docId list or the GetDocumentByID() You may not need that data, but you could determine if .NET is screwing something up locally while cleaning up or if OnBase is choking when streaming to file which... we assume is not the case.