I have developed a web application using the Lotus Notes/Domino Tag library (lotus.domino.taglib domtags.jar), I know need to implement connection pooling. My environment is Websphere as the application and web server and Domino as the database on a separate server. I am not using JDBC for connectivity but the domino tags DB, View, Form etc. to connect to the database.
Can you please tell me how to implement connection pooling for the Domino server. The following sample code has been suggested by the Lotus folks:
import java.io.IOException;
import javax.servlet.Servlet;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import lotus.domino.NotesFactory;
import lotus.domino.Session;
public class ConnPool3 extends HttpServlet implements Servlet
{
Session s = null;
static org.omg.CORBA.ORB orb = null;
static int count = 0;
static Object sem = new Object();
public void doGet(HttpServletRequest request,
HttpServletResponse response) throws IOException
{
try
{
synchronized (sem)
{
if ((orb == null) || ((count++ % 10) == 0))
orb = NotesFactory.createORB();
}
s = NotesFactory.createSession(“dominotest:63148”, orb, request);
//s = NotesFactory.createSession(“dominotest:63148”, uname, upassword);
String name = s.getUserName();
String p = s.getPlatform();
s.recycle();
response.setContentType(“text/html”);
ServletOutputStream out = response.getOutputStream();
out.println(“Information from servlet:
”);
out.println("
Name = " + name);
out.println("
Count = " + count);
out.println("Platform = " + p);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
All help and suggestions will be highly appreciated.
Thank you!
Bharat V Patel
Cincinnat, Ohio