Looking For a Lotus COM APIs Guru

It's probably a long-shot but I said I'd try and help out a customer of mine by trying to find a guru. Over to them:

We're looking for a Domino 'internals' expert/guru who can help us diagnose a fault occurring in our application which interfaces with Domino using the COM object APIs.

Our application runs a VBScript module using WScript.exe which essentially runs some Domino agents and reports the results of those agents back to our application. We regard each run of the VBScript module as a 'request', and it works fine whilst the loading is low. Unfortunately our application can generate hundreds of these 'requests' per minute during peak times, and after a period of peak runtime the Domino server often crashes.

Typically we end up with a "WScript.exe has generated errors and will be closed by Windows" error prompt. Our application tends to fail after this point with further "requests" failing. Quitting the Domino server typically results in a hang, followed by an automatic fault-shutdown-recovery and NSD output.

We have asked Lotus support for help with this, but after they examined the NSDs, they concluded that the fault was within WScript.exe (which we already knew) and said that they could not help any further. We suspect some kind of leak within the Domino COM side of things, but lack the technical knowledge to prove this.

So, we're looking for someone with extensive knowledge of Domino internals, ability to understand NSD logs, understand COM object access, being able to investigate threads, handles, pools etc.

If you know of anybody who can help (paid consultancy of course) then please comment here or let me know and I'll put you both in touch. Ta.


  1. Sounds like you need to rethink your application architecture to me.


      • avatar
      • Jake Howlett
      • Thu 19 Aug 2010 04:44 AM

      If only life were always that simple...

  2. Hello Jake,

    Please, could you send me some more information about your problem?

    Can we build a virtual-machines environment to tests it?

    Best Regards

    Josep Alemany

    • avatar
    • Nick
    • Thu 19 Aug 2010 06:00 AM

    What are you doing talking about Domino? I thought this was a Sharepoint Blog.....kidding kidding.

  3. Hello Jake,

    Most of the time the problems is not Domino related but is caused by changes in the script environment.

    I had similar problems from windows office 97 to 2003.

    For one application we still use Visual Basic 6 (www.shopfloordatacollection.nl)

    If you like I can look at the vbscript

    Regards Robert

    • avatar
    • Jorge Coelho
    • Thu 19 Aug 2010 06:17 AM

    Simple question. Is garbage cleanup being performed with the VBScript? In other words, every time the script runs is it releasing hold of the Domino object(s)?

    Whenever I've worked on the reverse to go to Excel you have to perform some type of garbage cleanup (e.g. ExcelObj = Nothing) to prevent multiple instances of Excel from being launched in the background.

      • avatar
      • Buzby
      • Thu 19 Aug 2010 07:50 AM

      Hi Jorge - yes our VBScript module has been carefully checked to ensure all objects are "Set x = Nothing" following their use.

      Show the rest of this thread

    • avatar
    • Erik Brooks
    • Thu 19 Aug 2010 06:59 AM

    And what version of Domino is installed? Is the COM running on the same machine? If not, what version of Notes/Domino is installed there?

      • avatar
      • Buzby
      • Thu 19 Aug 2010 07:50 AM

      Hi Erik - the version is 8.0.2FP5 and all functions are running on the same machine. To be honest, we've had problems with versions 6 & 7 of Domino too.

    • avatar
    • Christian Zalto
    • Thu 19 Aug 2010 07:20 AM

    First idea: Call "cscript.exe" instead of "wscript.exe" - "wscript.exe".

    Use "wscript.exe" only when user dialogs are needed, not in the backend.

    Second idea: Why do the scripts have to run on a Domino server?

    I have a similar setup but run the VBscripts on a Windows server

    with Notes client installed - however scheduled per Windows scheduler,

    not event based. If they have to run on the Domino server, do'nt

    start them in the same user and application context as the server.

      • avatar
      • Buzby
      • Thu 19 Aug 2010 07:56 AM

      Hi Christian - cscript.exe may be an idea because the request is not interactive, I'll take a look at that, thank you. The scripts have to run on Domino because we have an extensive database which we are making these calls to to access/modify data.

      Incidentally, we're accessing the databases locally in COM (Set lnDatabase = lnSes.GetDatabase("", "database.nsf", False)), which means the Domino server doesn't technically need to be running, although this particular server is part of a larger cluster infrastructure, so we require the server running in order to make use of the cluster replication side of things. Not sure if that is significant or not?

      Show the rest of this thread

    • avatar
    • Richard C
    • Thu 19 Aug 2010 08:08 AM

    If all they're doing is triggering an agent to do something and wait for the reply, instead of using COM stuff, would it be worthwhile using web-services instead?

    In relation to the Domino server crashing, could it be that there's too many sessions held open and Domino hasn't bothered to release some of them. We're running 8.5.1 and sometimes the Domino server(s) breach the "exhaustion point" after sudden load of new sessions which are triggered by a third-party software and slowly "dies" (restarting/rebooting is the only way to recover from this scenario).

    Try this: enter this into the Domino server's Notes.ini:


    NB: 1500 is our "magic" number, not IBM's magic number. You will have find your own "magic" number.

    IBM's support info: http://www-01.ibm.com/support/docview.wss?uid=swg21268894

      • avatar
      • Buzby
      • Thu 19 Aug 2010 09:04 AM

      Now that is very interesting - I'll take a look at that - thank you.

      Show the rest of this thread

  4. I don't know the threads piece, but the COM stuff I can talk about. I have an application in use that generates hundreds of COM requests (from C# to the Domino COM API) and it never crashes. We have never gotten an out of memory message with it at all. So I don't think COM has an memory leak - at least I have never seen one.

    Is the VBScript Module running on the server itself? What happens if you move it to a workstation that connects to the server via com. You would need the Notes client installed on that workstation. But that might not be a bad idea as a first test.

    If your looking for someone to talk about threads and the server, the best in the biz for that is Bob Balaban. We can help with some of the MS side and the COM stuff - but no one knows how the thread/handle/pool stuff of Domino, outside IBM, better than Bob.

      • avatar
      • Buzby
      • Thu 19 Aug 2010 09:09 AM

      Hi John - thanks for the advice.

      We've tried running COM access communicating through the server (both on the same machine and separate machines) rather than locally, unfortunately it is *way* too slow for our application. I guess that the network overheads are substantial, particularly given that our requests are quite small and numerous.

      Unfortunately the crashing tends to occur only at peak times so we'd have to massively inconvenience our (large number of) users in terms of slow speeds in order to see whether the crash still occurred in this scenario.

      I'll look up Bob though - thanks again.

  5. Can you post the fatal stack from the nsd or can you send me the nsd?

    • avatar
    • Shane
    • Wed 1 Sep 2010 01:31 AM

    I was tasked with fixing an application about 8 years back using the Java API. It was successfully crashing an AS400 every three or four minutes.

    My resolution, when IBM couldn't help, was to create a single global static NotesSession object and use that for all connections / work. It started when the app started and closed when the app closed. It was never released. There was only ever one instance

    I also did that as much as possible for my database object (where the database needed to be opened in a single thread ).

    i explicitly garbage collected (obj.gc) then set to null / nothing (in vb - set obj=nothing ) everything.

    I also got very anal about dimensioning objects in order and closing them in order ie parents open before children, children close before parents.

    This resolved the problems. The biggest resolution was a SINGLE SESSION object. however dont forget to close children before parents incase a reference is held open and the cascade collection of

    killing the parent doesn't clean up the child object and leaves pointers open - yes even in VB / Lotus Script.

    For what it is worth.

    My std sub or function now looks a bit like the following - note the catch all clean up in each sub

    --- CODE START ---8<----

    global gSession as NotesSession

    sub Initialise_StartHere

    on error goto errHandle

    'Start Globals

    set gSession = new NotesSession

    ' Run Main Sub / Function / Controller for App

    call Foo()

    finalExit: ' clean up globals

    on error resume next

    set gSession = nothing

    exit sub


    ' do what ever here if required.

    ' ie msg box, clean up or what ever

    goto finalExit

    end sub 'Initialise_startHere

    Sub Foo()

    ' this is the main control loop / app handler

    on error goto errHandle

    ' dim and initialise parent obs first

    dim db = as NotesDatabase

    dim view = as notesView

    dim dc as NotesDocumentCollection

    dim doc as Notesdocument

    dim item = as NotesItem

    set db = gSession.openDB .....

    set view = db.GetNotesview("Name")

    set dc = db.Search ....

    set doc = view.GetfirstDocument

    set item = doc.GetFirstitem(.....

    ' do my stuff here

    finalExit: ' this is the catchall Clean up

    on error resume next

    ' kill everything even if it doesnt exist just in case

    'kill child before parents

    set item = nothing

    set doc = nothing

    set dc = nothing

    set view = nothing

    set db = nothing

    exit sub


    ' do what ever here if required.

    ' ie msg box, clean up or what ever

    goto finalExit

    End Sub 'Foo

    --- CODE END --->8----

  6. Jake - if this hasn't been resolved yet, I could probably help

Your Comments


About This Page

Written by Jake Howlett on Thu 19 Aug 2010

Share This Page

# ( ) '


The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social

About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content