Hi,
In Onsubmit event on a form, I want to run an agent on a domino server. For this, I use the lotusscript statements:
id = source.document.noteid
set agent = db.getagent(“agent”)
agent.runonserver(id)
When I do this, control is not returned immediately to the notes client.
Note that the agent updates many documents (about 250000). Does the control return to the client after agent execution completes ?
That’s not what I want. Does my agent really run on the server or does it run locally ?
Thx for any ideas.
dd
Subject: Running agent on server
Control returns to the server when it completes.The agens really runs on the server.
For more information refer to Agent FAQ which has an article with everyone you might ever want to know about RunOnServer called “Run and RunOnServer passing parameters”.
Your other alternative are runnign an agent on the client (in the background thread or on the forefround thread), running a scheduled agent on the server, or runnign a scheduled agent on the client.
Subject: Running agent on server
-
That runs the agent on the server, but it blocks, ie, does not return. I see Help conveniently omits this important bit of information, at least in R6.- I’m not sure how you’d run an Agent without blocking. LotusScript isn’t well suited to multi-threading, where the same LS creates and manages multiple threads, ala Java.
-
I’d try creating a Java agent that launches your update Agent, but does so in a separate thread. Java can do that easily, then return control to your application. Or you could use a servlet to do the same thing. The important point is to invoke your Agent using Java because it handles multi-threading with ease.
-
Hope this helps…
Subject: RE: Running agent on server
David, Your post had several inaccuracies.
- Help documents it as well as suggestions a solution if tha tis not what you want
From help:
To run an agent without having to wait until it completes, check “Run in background client thread.” The article on “RunOnServer” in the Agent FAQ also discusses the asynchronous nature of this method.
-
- I’m not sure how you’d run an Agent without blocking. LotusScript isn’t well suited to multi-threading, where the same LS creates and manages multiple threads, ala Java.
As suggested a help, using backgtround thread could be of use of there if runnig the agent on the server is not a requirement. This is new in R6, and more details on this new feature can be found in the Agent FAQ “Decoding ND6 agents”.
Subject: RE: Running agent on server
Thx all for your explanations.
I will try to use Java.
Subject: RE: Running agent on server
Please read my other post, you might have a simpler solution by using a background thread.