I do have the following situation:
"ScheduledJobs.nsf"
with the agent"Worker"
- The
"ScheduledJobs.nsf"
is replicated on three domino server:DominoServer1
,DominoServer2
,DominoServer3
- With the
Lotus Notes Connector
im able to establish a connections overIIOP
to the Notes Database"ScheduledJobs.nsf"
onDominoServer1
. This connections is static configured. - Because there is connections to the Notes database, im able to run the agent
"Worker"
on the Notes Database"ScheduledJobs.nsf"
onDominoServer1
overJavascript
.
What I would like to do is this:
Sometimes, depending on the situation, I would like to run the Agent "Worker" from the replica. For example I would like to run the agent "Worker" on DominoServer2
or DominoServer3
.
Problem:
Due to the connection to the Notes Database over IIOP
is static, im always connecting to the database "ScheduledJobs.nsf"
on the DominoServer1
.
Question:
Am I able to run the agent "Worker"
after this IIOP
connection on the replica?
EDITED
My code for "RunWorkerOn2"
Dim agent As NotesAgent
Dim sess As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim item As NotesItem
Set db = sess.CurrentDatabase
Set agent = sess.CurrentAgent
Call db.Open( "DominoServer2/ORGANIZATION", "ScheduledJobs.nsf" )
Set agent = db.GetAgent("Worker")
// Reason why im using 'run' insted of RunOnServer:
// https://www-01.ibm.com/support/docview.wss?uid=swg1LO42549
If agent.Run() = 0 Then
Print "SUCCESS"
Else
Print "FAILED"
End If