How to recycle Notes objects in XPages and Java

May 28th, 2013

Using Notes objects in XPages and in Java require that you recycle those objects in order to avoid memory leaks and backend out of memory issues. Here I will summarize how to do proper recycling in XPages for server-side javascript, Java and Java using the new OpenNTF project org.openntf.domino.

Server-side JavaScript

With server-side JavaScript you have to use the recycle method available on Notes objects and you have to "nullify" your server-side JavaScript variables. Thank you, Tony McGuckin, for clarifying this.

Here's a very simple example that assumes that the variable doc has been initialized elsewhere:

doc = null;


In Java you have to use the recycle method available on Notes objects. So for looping through a document collection you have to do this:

try {
	Database dbCurrent = ExtLibUtil.getCurrentDatabase();
	DocumentCollection dc = db.getAllDocuments();
	Document doc = dc.getFirstDocument();
	While (doc != null) {
		// process doc
		tmp = dc.getNextDocument(doc);
		doc = tmp;
} catch (NotesException e) {


With org.openntf.domino you do nothing with regards to recycling! So when looping through a document collection you can concentrate on your business logic:

Database db = Factory.getSession().getCurrentDatabase();
for (Document doc : db.getAllDocuments())
	// process doc

OpenNTF webinars for the open source community

May 6th, 2013


OpenNTF has announced a new initiative called OpenNTF Webinars.

The first webinar takes place tomorrow, Tuesday May 7, and is all about OpenNTF. Join the web meeting and hear Bruce Elgort, Serdar BasegmezJesse Gallagher, Niklas Heidloff, Peter Tanner and me talk about OpenNTF and about what OpenNTF can offer the open source community.

Future webinars will be announced at the webinar landing page.

Using an existing SSL certificate on IBM Domino

May 2nd, 2013

A customer of mine had an existing wild card SSL certificate running on IIS. They wanted to use this wild card SSL certificate for their IBM Domino server.

I had all the SSL certificate files available (the trusted root CA, the certificate and the private key). So I quickly found the guide from Gab Davis and did something similar: I created a key ring using the Server Certificate application on the Domino server and installed the trusted root certificate into the key ring. I then opened the key ring file in the gsk5 version of iKeyman (on Windows XP in order for it to run) but ran into the issue that I was unable to import the private key (.pfx).

The solution was to import the private key file in the Certificates program (certmgr.msc) by opening the private key file (and providing the password for the file and selecting the option to mark the key as exportable). Once imported I then exported the same private key as PKCS#12 (.pfx) and I was now able to import the private key as a personal certificate in the gsk5 version of iKeyman.

I saved the updated key file, added it to the IBM Domino server, and HTTPS was then working as expected.

How to force a reload of JS and CSS files when changed

April 10th, 2013

Caching of Javascript and CSS files is great and really improves performance in the browser. But caching also means that changes to the files are not picked up. So how do you get the browser to automatically reload the files when you have updated them because of new requirements, bug fixed etc.?

There are several ways to achieve this. On Apache you can for instance use the modpagespeed module that automatically changes links to resources when the backend resource files change. Other ways include manually adding a version number to your resources (?version=1234), and changing the file name of the resource.

For IBM Domino, IBM XWork Server and XPages you can of course manually change the file name of your resources when content changes (and remember to update references to those files in your code). A better method is to create your own versioning system for your resources based on the idea of adding a unique id to the link to the resources. The following describes this method.

You can add a version number to an application scoped bean and then update that version number whenever you want the browser to reload your resources. Here's a code snippet for such a version number bean (this is only some of the stuff needed for a bean - see my blog post about creating a bean for more details) :

public class Config implements Serializable {
	private static final long serialVersionUID = 6469339826789980362L;
	private static final String version = "20130410";

	public static String getVersion() {
		return version;

Using this bean I can then create links to my Javascript and CSS files like this:

	<xp:script clientSide="true">
		<xp:this.src><![CDATA[${javascript:"/jsCommon?open&v=" + config.getVersion()}]]></xp:this.src>
		<xp:this.href><![CDATA[${javascript:"/custom.css?open&v=" + config.getVersion()}]]></xp:this.href>

The links then look like this in the browser:


Whenever I want to force a reload, I then update the version string in my Config bean. The resources are then reloaded.

Free 1-day seminar on April 24 hosted by

March 20th, 2013

I am proud to announce a free 1-day seminar hosted by The purpose of the seminar is to show companies the powerful features of IBM Notes 9, IBM Domino 9, IBM XWork Server 9, IBM Connections 4.5, XPages and much more - including case stories. The seminar is for existing IBM Domino customers and for potential IBM Domino customers, and takes place on April 24.

Have a look at the agenda and sign up to attend if the seminar is of interest to you. The seminar and online content is in Danish.

IBM Connect 2013 Update with Intravision

February 19th, 2013

Intravision is hosting two IBM Connect 2013 Update seminars in Copenhagen on February 25 and in Århus March 6 where speakers from Intravision and from IBM will share news from IBM Connect 2013.

I am happy to have been invited by Intravision to speak about news from IBM Connect around XPages. I will be speaking about the IBM Social Business Toolkit, integration between XPages and IBM Connections, Embedded Experiences and more.

Remember to register if you are interested in attending one of the seminars.

My impressions from IBM Connect 2013

February 9th, 2013

Here are my impressions from the IBM Connect 2013 conference that I attended last week.

Social collaboration
IBM connections 4.5 is coming this March and is improved in many areas such as the new file sync feature.

Customers with a valid IBM Domino entitlement can continue to use IBM Connections Files and Profiles features for free.

Embedded applications in IBM Notes, IBM iNotes (web mail) and IBM Connections activity streams make it possible to act on business applications directly within the context of your mail or your activity stream.

Business applications
The IBM platform for building powerful business web applications for the IBM Collaboration Solutions platform across desktop, tablets and smartphones is XPages running on IBM Domino 9.0 or IBM XWork Server 9.0.

The platform contains many improvements such as including the XPages Extension Library in the default server and client install. XPages Extension LIbrary makes development and deployment of modern business applications faster and more powerful.

The license for IBM XWork Server 9.0 is now $1,000 per 8 databases which further makes the IBM XWork Server a very competitive platform for business web applications.

The IBM Social Business Toolkit (IBM SBT) allows you to integrate the different IBM Collaboration Solutions products. You can as an example use  the SBT to create embedded experiences in XPages that runs in the activity stream of IBM Connections. You can check out the features of IBM SBT in the Social Business Toolkit Playground.

IBM Domino 9.0, IBM Notes 9.0 and IBM iNotes 9.0 continues to be the center of mail and messaging.

IBM Domino 9.0 makes it easy to migrate from Microsoft Exchange by using the Domino Migration Utility which is part of the 9.0 installation.

IBM Connections Mail makes it possible to use mail directly within the context of IBM Connections.

IBM Notes and IBM Domino
IBM Notes 9.0 Social Edition and IBM Domino 9.0 arrives in March 2013. The roadmap for IBM Domino has detailed plans until 2015 - showing a strong commitment from IBM towards IBM Notes and Domino.

The IBM Notes 9.0 client comes with many improvements in areas such as usability, productivity, and social collaboration - including a browser-based version of IBM Notes (Notes browser plugin) for use in combination with for example iNotes to be able to access applications that do not have a web frontend. IBM Notes 9.0 Social Edition also provides an activity stream for your IBM Connections updates and for embedded experiences for custom-built business applications.

The IBM Domino 9.0 server adds lots of improvements to security (such as the option to run IBM Notes with no need for a local ID file!), OS support (Domino is finally available in a 64-bit version for Linux), maintenance, serviceability and performance.

IBM can help you double check your investment in IBM Notes and Domino. Contact IBM for a free engagement where IBM will analyze your Domino environment and give you facts that you can use when comparing Domino with alternative solutions. IBM uses DNA by Trust Factory for this analysis. This offering is now called IBM Domino DoubleCheck - Powered by Trust Factory.

IBM does cloud too (and at a great price) - whether it's about moving your mail to the cloud, adding social collaboration including collaborative editing of documents and instant messaging or going hybrid (cloud and on-premises servers).

With the before metioned IBM Social Business Toolkit you can extend your on-premises business applications in the cloud.

The IBM Sametime product family will be enhanced with version 9 which is expected in the second half of 2013.

Final thoughts
Overall it's a very impressive product family.

Personally, I look forward to continue to build great business applications based on XPages for my customers.

All presentations from the sessions at IBM Connect 2013 are available for registered attendees. Some of the presentations from the sessions are also available publicly. Furthermore, some sessions have been recorded and are available as video including the Opening General Session.

Experience IBM Notes 9.0 Social Edition

February 5th, 2013

Experience Notes 9

IBM Notes 9.0 Social Edition is coming in March 2013. Read all about the new features and download reference sheets with more detailed info at the updated Experience IBM Notes site.

Slides from SPOT104 “How We Built in a Matter of Weeks”

February 1st, 2013

Here is the presentation that Bruce Elgort and I used for our IBM Connect 2013 session called "How We Built in a Matter of Weeks".

How We Built in a Matter of Weeks from Per Henrik Lausten

Thanks to all that attended our session. It was a great experience for me as a 1st time speaker at IBM Connect/Lotusphere.

I have been nominated as IBM Champion for IBM Collaboration Solutions for 2013

December 17th, 2012

I am truly honored to have been nominated as IBM Champion for IBM Collaboration Solutions for 2013. Thanks!


I look forward to seeing a lot of them at IBM Connect 2013.