Java .send() method causes Notes client to hang

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

http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/fe057e6d8b34509e8525713b00515e8d?OpenDocument

and

http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/8d08d61a2d9a991685256ca700495517

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.

Subject: Some more info

Narrowed it down to some form of “Mail Notification”.If we remove the mailfile from the person document, then the server cannot route mail to our mail file, which thus prevents the “mail notification” process from starting. Thus the Java agent will complete correctly and the Client does not hang.

As soon as the Server can route mail to the sender, then the sender’s mail notification seems to kick in and crash the client.

As a workaround, and for developers to NOT have their clients crashing, whatever sending agents are created should not e-mail the sender.