Q
Problem solve Get help with specific problems with your technologies, process and projects.

Checklist for document database access

I have a LotusScript agent that accesses documents in other databases. The database containing the agent and the databases the agent is trying to get a handle on, all reside on the same server. The agent signer has Manager rights to all databases.

The agent runs perfectly when executed from the menus, but fails when run on a schedule. I have traced the problem to the following line:

db = session.GetDatabase
("ServerName", "DBName", False)

The db object is null when run on a schedule. I have set runtime security (via the 2nd tab in the agent properties) to every available setting with no effect.

I have tried leaving the ServerName parameter blank:

db = session.GetDatabase("", "DBName", False)

I have tried specifying the ServerName parameter as follows:

db = session.GetDatabase
(session.CurrentDatabase.Server, "DBName", False) 

Nothing seems to work, and I have exhausted both my abilities and my patience. Do you have any suggestions?

The second call is the correct one for a background agent. The others will not work in the background. Even if the database you are trying to access a database on the same server in background agent, specifying a server name makes the server think that you're trying to access another server, and it will fail.

Otherwise, it sounds like a security-related issue. If the ID signing the agent does not have rights to open the target database, then the db object will not be instantiated.

Here are a few things to check:

  • Ensure that your code actually includes the word "set" before "db", because you are trying to instantiate an object handle, so that keyword is needed.

  • Ensure that the session object is instantiated properly.

  • Ensure that the agent is not using any UI classes (which would cause any background agent to fail).

  • Verify the agent's runtime security level to be appropriate to the type of actions it's performing.

  • Try re-signing the entire database design with the same ID, just to be refresh the signature.

  • Try signing the agent with another ID (preferably the server's ID) that has rights to access the target database. This could at least help confirm whether it's a security issue and not a code issue.

If all else fails, read through Julie Kadasevich's articles on troubleshooting agents at IBM Developer Works.


Do you have comments on this Ask the Expert question and response? Let us know.

Dig Deeper on Lotus Notes Domino Agents

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close