I have the following problem in a Notes java agent : This program is having a loop of : memo.send(false, email); to perform massive mail send.
This loop get frozen on the memo.send order after some sent (3 or 5 its depends).
Nota:
-
All mailing are for IBM employee using their internal mail address
-
This problem is under Notes Release 8.5.1 SHF29.
-
Running under Notes Release 8.0 it is Ok
Any idea?
Subject: How can I post my code
Carl,
My code is a part of a whole Notes application , not easy to extract.
how can we proceed?
Subject: Without your code hard to proceed.
Maybe as you’re an IBMer you can get help from within IBM, someone that understands notes could look at your application.
Are you calling recycle regularly? Are you clearing any objects that you no longer use etc.
Subject: here is a code
import lotus.domino.*;import java.text.SimpleDateFormat;
import java.util.*;
import java.io.*;
import java.io.PrintWriter;
public class JavaAgent extends AgentBase {
public static int rc=0;
File file;
String fileString;
static BufferedWriter lockfile;
static BufferedWriter logfile;
static BufferedWriter repfile;
Session s;
AgentContext ac;
Database db;
Document memo;
Log log;
String m = new String();
public void NotesMain() {
System.out.println("****************** Start send *********************");
try {
s = getSession();
ac = s.getAgentContext();
db = ac.getCurrentDatabase();
log = s.createLog("TestSendMailInLoop in " + db.getTitle() + " on " + db.getServer());
log.openNotesLog(null, "alog4.ntf");
log.logAction("started");
for (int x=0; x < 50; x++) {
memo = db.createDocument();
memo.replaceItemValue("Form", "Memo");
memo.replaceItemValue("Subject", "send email in loop" + x);
memo.replaceItemValue("SendTo", "lolive@fr.ibm.com");
memo.setSaveMessageOnSend(true);
boolean suc = memo.computeWithForm(true, false);
log.logAction("about to send memo " + memo.getItemValueString("Subject"));
memo.send();
System.out.println(" send mail " + x + " done") ;
// memo.recycle();
memo=null;
}
// if (memo!=null)
// memo.recycle();
//if (db!=null)
//db.recycle();
//if (ac!=null)
//ac.recycle();
//if (s!=null)
//s.recycle();
log.logAction("end");
System.out.println("Test send memo inloop ended");
} catch (NotesException ne) {
ne.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
}
hcl-bot
6
Subject: Have you found the solution
Hi,Have you found the solution. the same problem is getting repeated here also
hcl-bot
7
Subject: Same issue
I am also having the same issue. Does anyone have a solution?