Using the java method lotus.domino.document.send(), method, within a loop can cause the Lotus Notes Client to hang. This has now become almost a random event
In follow up to the following threads
and
Have been able to use the “Run in Background Client Thread” as a kludge for most development, but have got to the point where even with this flag on, the Lotus Notes Client hangs on a java.send()
Using the following code within an agent will illustrate how it fails.
import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
String strFrom = "Rafez Noorullah";
String strTo = strFrom;
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Agent ag = agentContext.getCurrentAgent();
Database db = agentContext.getCurrentDatabase();
for (int y=1;y<1000;y++){
Document docResponse = db.createDocument();
docResponse.replaceItemValue( "Body" , "Some empty body" );
docResponse.replaceItemValue( "Subject" , docResponse.getUniversalID() + ". Count=" + y );
docResponse.replaceItemValue( "Form" , "Memo" );
docResponse.replaceItemValue( "SendTo" , strFrom );
System.out.println( "Sent e-mail. Count = " + y );
docResponse.send();
docResponse.recycle();
}
} catch(Exception e) {
e.printStackTrace();
}
}
}
Whether the recycle line is in or not, the Agent still hangs a Notes client.
Don’t know of a workaround, but this affects R7.0.2 W32 Clients on R7.0.2 AIX Servers.