Lotus Notes Session.Initilize() Stops working (hangs)

Posted on 2007-07-23
Last Modified: 2013-11-26

I am using a Web Frontend developed in ASP.NET with VB to connect to a Lotus Notes Database Like this:

Dim s As New Domino.NotesSession
Call s.Initialize("12345") 'The password of the Notes Id on the server is 12345

This is working - sort of :)

It connects fine, for a while, then it just stops working
It hangs on the s.Initialize Function. I don't receive any error messages, no timeouts..
the only way to get it working again is to restart the server. (which is busy and then has to restart at night)

Why would it work and just stop working.??
Thanks in Advance,

Question by:PierreBeukes
    LVL 63

    Expert Comment

    1) Are you closing your sessions properly ?

    2) DId you check to see if this has multiple instances that may be causing issues ?

    3) Did you check the Notes Server log.nsf ?

    4) Have you added any debugging code ?

    I hope this helps !
    LVL 3

    Author Comment

    1) In - s (the notes session variable) doesn't seem to have a close propery to call, it is connecting in its own function, so it should dispose of the variable once it exits the function.... maybe it doesn't close the session properlly.

    2) No I have not.. how can i check that? because evertime the function gets called, it will create its own instance of the variable.

    3) ... No, I will check the log.nsf file - this should be on the server in the data directory right?

    4).  No, it is from VB and when it executes the line to initialize - it is on that line that it hangs on - i don't receive any error messages though.

    Thanks for the response, looking forward to your answers.
    LVL 46

    Accepted Solution

    Hello PierreBeukes,

    Some info from the Notes Help databases:

    "To access the Domino Objects, create a NotesSession object with either the following:
    Dim session As New NotesSession
    Dim session As NotesSession
    Set session = CreateObject("Lotus.NotesSession")
    So, instead of the Domino.NotesSession, I'd use plain NotesSession or Lotus.NotesSession.

    "You must explicitly initialize a COM session with one of the following NotesSession methods. These methods do not apply to LotusScript applications.
    Call session.Initialize("passwordOptional")
    Call session.InitializeUsingNotesUserName("name", "passwordOptional")
    The parameters are all strings. The name parameter can be an empty string. The password parameter is optional.
    Initialization occurs as follows:
    Initialize: this method can be used on a computer with a Notes client or Domino server and bases the session on the current user ID. If a password is specified, it must match the user ID password. If a password is not specified, the user is prompted for a password as required and as the software permits. If the software does not support prompting (for example, VBScript under ASP/IIS), you must supply the password or the user ID must not have one.
    I suppose you have Notes installed locally?

    LVL 63

    Expert Comment

    2) Use the Process explorer from ( now Microsoft owned )  to check for  multiple instances.

    3) Yes in the data dir

    4) Add debug code  ON error or similar and capture an error info.

    I hope this helps !
    LVL 31

    Assisted Solution

    1) We alsoways make it a parctice to NOT put passwords on our server files, because of restart issues

    2) You can also try connecting without the Notes ID and password -- there is a version called NotesSession.InitializeUsingNotesUser Name.  This allows you to pass the ID name and the **web** password, instead of relying on the server.ID file and the server's password.
    LVL 3

    Author Comment

    qwaletee: , What do you mean by This allows you to pass the ID name and the **web** password, instead of relying on the server.ID file and the server's password.

    any examples on this?
    LVL 31

    Expert Comment

    Sure.  Let's say you want to have the rights of a user names "Automatic Web Processes/PB Companies" and you have registered that user with a password of "on-the-Web-PW" (HTTP password value)

    You can then run an ASP.NET script on your Domino server with the following code:

    Dim session As NotesSession
    session = CreateObject("Lotus.NotesSession")
    session.InitializeUsingNotesUserName ("Automatic Web Processes/PB Companies", "on-the-Web-PW")

    Everything else works the same. You are limited to accessing NSF files locally. If you have a way to call out to Java routines, you could also do the same remotely using NCSO.jar or

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
    Article by: Rob
    Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    This video discusses moving either the default database or any database to a new volume.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now