How to close lotus.domino.Session in Java application?

I’m looking for a way to close lotus.domino.Session.

I’m developing a server program written in Java that implemented Domino connection(lotus.domino.Session) pooling.

Because Domino server is located in a remote box,

I use remote session.

The problem is lotus.domino.Session or lotus.domino.NotesFactory class doesn’t (seem to )provide a method that close(/terminate/destroy) the connection.

Sample programs don’t close Session.

What I do is as follows:

Session session = NotesFactory.createSession(…);

// do someting…

session.recycle();

session = null;

Even when the session is set to null, the underlying TCP(CORBA) connection doesn’t get closed.

TCP connection gets closed only when the DIIOP idle timeout reaches and Domino server terminate the connection.

I’m afraid it would cause a TCP connection leackage.

What is a recommended way to close lotus.domino.Session?

Thanks in advance!

Subject: how to close lotus.domino.Session in Java application?

The way to close a remote session is to call session.recycle() to release resources on the server. You are right though that the TCP connection doesn’t close. The way to do it, IMHO, is to do as you do:Session session = NotesFactory.createSession(remote args);

session.getUsername();

session.recycle();

session = null;

Nullifying the session should release the TCP connection at some point. It is my experience that it isn’t a problem…

/Mikkel Heisterberg

Visit my blog @ http://lekkimworld.com

for posts on Notes/Domino, Sametime 7.5 development and how to use Java in Notes/Domino…

Subject: RE: how to close lotus.domino.Session in Java application?

Got this URL (IBM - United States) as part of a comment on my blog - don’t know if that will help you since I haven’t read the article myself.

/Mikkel Heisterberg

Visit my blog @ http://lekkimworld.com

for posts on Notes/Domino, Sametime 7.5 development and how to use Java in Notes/Domino…