C# Lotus Notes Problem AllocHandle: OUT OF PRIVATE HANDLES!


hi,

i have issue getting below error when interrogating notes database through c# application.

allochandle: out of private handles! -- pid 00000f38 handles used far 6339, maximum handles - 16440, error - 0x107

maximum number of memory segments notes can support has been exceeded

i understand error due domino private handles limit being reached believe 6,339 although i've read has been increased on 10,000 in more recent versions.  can't lotus notes infrastructure in company trying work around issue.

the notes database need search has 10,000 dcouments view can't searched on using field wan't find.  i've devised way can work out required document number need in case value i'm looking doesn't exist have check value of notes item in each of 10,000 documents.  in situation above error when hit around 6,000 checks mark.

the code i'm using similar below,

notessession session = new notessession();
session.initialize(password);
notesdatabase notesdb = session.getdatabase("notesserver", "anotesdb.nsf", false); //open notes database
notesview pwdview = notesdb.getview("(anotesview)");

for (int = startingdocno; <= startingdocno + 1111; i++)
{

notesdocument ndoc = pwdview.getnthdocument(i);
notesitem noref = ndoc.getfirstitem("anotesitem");
                            if (areference ==noref.text)
                            {
                                notesitem thevalue = ndoc.getfirstitem("valueineed");
                                valtoreturn = thevalue.text;
                                thevalue = null;
                                break;
                            }

                            ndoc = null;

}

pwdview = null;
notesdb = null;
session = null;

i have tried executing code in chunks of 1,000 documents still error.  thought initializing new notessession object after nullifying previous 1 reset handle count.  tried spawning new thread process each 1,000 documents thinking if new thread round limit still no luck.

has got ideas how work around problem, i'm pretty stumped!

thanks

richard

is effect if after each ‘ndoc = null’, or after loops of 1111 items, execute this:

gc.collect();
gc.waitforpendingfinalizers();
?



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'