Manage Learn to apply best practices and optimize your operations.

Debugging agents with loops that run on the server

I created a mail doc and I send it to me (or any other address) as the mail processes at pre-defined intervals.

We all know how frustrating it can be to debug those agents that run on the server.

When you have loops you never know if the agent is running or is in an endless loop.

What I do is that I create a mail doc and I send it to me (or any other address) as the mail processes at pre-defined intervals (1000 in the example)

dim ses as new notesSession
dim db as notesDatabase
dim doc as notesDocument
dim dcol as notesDocumentCollection
dim counter as long
dim mailDoc as notesDocument

set db = ses.currentDatabase
set dcol = db.unprocessedDocuments
set mailDoc = db.createDocument

mailDoc.sendto = "abc@xyz.com"

set doc = dcol.getFirstDocument
while not doc is nothing
...
... Your loop processing code 
...
...

counter = counter + 1
if counter mod 1000 = 0 then
mailDoc.subject = "Processed up to: " & format(Counter,"#,##0")
call maildoc.send(true)
end if
set doc = dcol.getNextDocument(doc)
wend
This was last published in March 2002

Dig Deeper on Lotus Notes Domino Administration Tools

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