IBM Lotus Notes Domino DLL

Subbu

The Domino interop API which is included with Lotus Notes causes an out of memory exception in .NET when the NotesDXLExporter class based object fails to export the 390th record, which is a big document, after exporting 389 records (which are smaller documents).

Here is a code snippet:

  1. I initialize the NotesDXLExporter class.

    NotesDXLExporter dxl1 = null;

  2. I then configure the NotesDXLExported object as shown below:

    dxl1 = notesSession.CreateDXLExporter(); dxl1.ExitOnFirstFatalError = false; dxl1.ConvertNotesbitmapsToGIF = true; dxl1.OutputDOCTYPE = false;

  3. I then perform a for a loop shown below in reading documents using the dxl1 class (line on which exception occurs is indicated below).

    NotesView vincr = database.GetView(@"(AllIssuesView)"); //view from an NSF file for (int i = 1; i < vincr.EntryCount; i++) { try {

                    vincrdoc = vincr.GetNthDocument(i);
    
    
                        System.IO.File.WriteAllText(@"C:\Temp\" + i + @".txt", dxl1.Export(vincrdoc)); //OUT OF MEMORY EXCEPTION HAPPENS HERE WHEN READING A BIG DOCUMENT.
    
    
                }
                catch(Exception ex)
                {
                    Console.WriteLine(ex);
                }
    

I have tried using a different version of the Interop domino dll and had had no success.

As I understand this, I see an API issue but I dont know if I am missing something?

Can you please shed some light on this?

Thanks in advance.

Subbu

Richard Schwartz

You haven't said what version of the Lotus Notes you are working with. Given the history of DXL, I would say that you should try your code on the latest version of Notes that you possibly can.

But also, I don't see any calls to recycle(). Failure to call recycle() for Domino objects causes memory to leak from the Domino back end classes, and since you are running out of memory it could be contributing to your problem. You should also not use a for loop and getNthDocument. You should use getFirstDocument and a while loop with getNextDocument. You'll get much better performance. Putting these two things together leads you to the common pattern of using a temporary document to hold the result of getNextDocument, allowing you to recycle the current document, and then assign the temp document to the current, which would be something like this (not error-checked!)

NotesView vincr = database.GetView(@"(AllIssuesView)"); //view from an NSF file 
vincrdoc = vincr.getFirstDocument();
while (vincrdoc != null)
{ 
   try {
       System.IO.File.WriteAllText(@"C:\Temp\" + i + @".txt", dxl1.Export(vincrdoc));     
   }
   catch(Exception ex)
   {
       Console.WriteLine(ex);
   }
   Document nextDoc = vincr.getNextDocument(vincrdoc);
   vincrdoc.recycle();
   vincrdoc = nextDoc;

}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

lotus notes/ibm notes/domino 9 - how make emails read/unread programmatically in lotus script?

zabbix authentication with IBM Lotus Domino

java agent for IBM domino lotus

Version Control in Lotus Notes/Domino on Server

Keeping databases open in Java agent IBM Domino / Lotus

lotus notes domino designer text field contains special characters?

Issue with Lotus notes Anonymous access on Domino12

Problem with IBM Notes ODBC Connections not clearing out on Domino 9 server

How Do I write an IBM (Lotus) Notes Client?

IBM Lotus Notes 5.0.9 - Creating a custom mobile app

How to run CoSign Signature SOAP API in IBM Lotus Notes?

How to get document when I select a document in IBM Lotus Notes

Web service for Adding contacts to my Lotus Notes account using Domino Designer

How to register a Web User only (without a lotus notes id file) in Domino Directory

how to insert a new notes document in the domino server with c# and the usage of interop.domino.dll?

IBM Domino - Authentication with IBM Domino LDAP

Formatting a view lotus domino designer

IBM Domino and Java 8

IBM domino design librarys

How to convert .nsf (IBM Lotus Notes) to .pst (MS Outlook) or other mail client format

Java IBM Lotus Notes retrive data from view fails in the middle due to null object

How to set the template version on a Notes (Lotus/IBM/HCL) application master template

Lotus Domino data as JSON - Propertie Names

Importing Angular library into Lotus Domino db

Lotus Domino c# LtpaToken class

svn: Checksum mismatch in Lotus Domino SVN

Lotus Domino Resolve Email Address (From, To)

IBM Domino: View formula with @now

Where is IBM Lotus Symphony today?