IBM Support

Error: 'Database <filename.nsf> has not been opened yet' when accessing database with agent

Question & Answer


Question

A Lotus Notes® agent results in the following error message:

    "Database <filename.nsf> has not been opened yet."

The problem happens always at same time in the day and only on one particular server, not on other replicas.

Answer

In this particular case, the creating a new replica of the database resolved the issue.

Supporting information:
This error can also occur for additional reasons which are more typical.

  • When using the LotusScript NotesDbDirectory class or the Java DbDirectory class to cycle through databases, the class's methods are not designed to automatically open the database object. In this scenario, the NotesDatabase Open method must be called after obtaining the handle to the NotesDatabase object, prior to accessing any of the obect's properties or methods.


  • For example, with Java, you would add the following code to open the database object:
      if(!db.isOpen()){
        System.out.println("Database is not open, opening...");
        db.open();
      }
    For additional details on this topic relating to LotusScript, refer to Document #1102719, "CurrentAccessLevel property of NotesDatabase class returns 0 unless the database is open."

    NOTE: Other Lotuscript and Java methods automatically open a database when they return the handle to the database object. It is not necessary to call the Open method.
  • A similar error noting that a user cannot access a database can be relative to the access rights. For additional detail, refer to Document #1179187, "Accessing LotusScript NotesDatabase Size Property Returns Error 'User ... Cannot Open Database ...'."
  • In Notes/Domino 5.x, there was an issue specific to accessing the Domino Directory which frequently returned this error. This issue was fixed in Notes/Domino 5.0.11 and 6.0 and does not affect later releases.

Internal Use Only

Contributors: Brian Hussey (Java detail), Matt Garoian (additional detail)

A Lotus Notes agent results in the following error message: "Database has not been opened yet." The problem happens always at same time in the day and only on one particular server, not on other replicas.

[{"Product":{"code":"SSKTWP","label":"IBM Notes"},"Business Unit":{"code":"BU003","label":"Collaboration Solutions"},"Component":"Replication","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF014","label":"iOS"},{"code":"PF033","label":"Windows"}],"Version":"8.0;7.0;6.5;6.0;5.0","Edition":"All Editions"}]

Document Information

Modified date:
16 June 2018

UID

swg21203997