English 中文(简体)
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

问题回答

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.

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.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签