John Bautista
John Bautista

Reputation: 1480

Refreshing profile documents in XPages

I created a profile document in Lotus Notes that saves a boolean value. Then I created an XAgent that returns the value as plain text (either true or false). The problem is: when I changed the value of the profile document in the Lotus Notes client, the changed value is not returned by the XAgent even though I tried refreshing the XAgent page, closing the browser or using a different browser. The change appears only when I restart the HTTP task ('tell http restart') in the server. Is there a way to always get the fresh document profile values immediately? I've been searching for hours how to programatically clear the web server cache or the like but to no avail. I know that profile documents are not supposed to be changed frequently, but I;m doing this for testing's sake.

Please help me.

Thank you very much! :D

Upvotes: 1

Views: 1490

Answers (2)

angryITguy
angryITguy

Reputation: 9551

Are you using an actual "Profile" document like this ?

Call workspace.EditProfile("Interest Profile", session.UserName)

Profile documents have been around for very long time, and their usage was intended to be quite simple, and not designed for regular updating. It has since been mis-interpreted as the general "scratch pad" for processes.

Generally, I do not recommend their usage because Domino cache's profile documents irrespective of HTTP, and they are more awkward to manage. This is especially difficult when you have replicas floating around on other servers.

So, the alternative is to use normal documents, and access them via a regular getdocumentByKey method. This allows you to manage them directly, which in turn makes it easier to maintain.

Upvotes: 5

leyrer
leyrer

Reputation: 1492

For performance reasons, the Domino http (and XPages) engine caches pages and documents. And this includes profile documents.

One workaround that would work is to update the profile document not though the Notes Client, but via a Web Agent. This way, the HTTP engine is running the agent, so it should be able to recognize that the profile has changed and that its cache needs to be rebuilt.

Another workaround would be - if this is an Xpages only solution - to use scoped variables and properties files to store the information.

Other than that, the only "solution" I can think of, is to re-implement "profile documents" with "regular" documents and views.

Upvotes: 3

Related Questions