문제

I'm trying to get a value from a profile document in the beforePageLoad event of my XPage. To do this I use Server Side Javascript:

var currdb:NotesDatabase = database;
var profdoc:NotesDocument = currdb.getProfileDocument("frmProfile","");
var showRefInfo = profdoc.getItemValueString("ShowReferenceInformation");
sessionScope.put("showRefInfo",@Text(showRefInfo));

The field "ShowReferenceInformation" can have a value of either 1 or 0. I have changed this value from 0 to 1, however my SSJS code continues to return 0. What could be causing this?

도움이 되었습니까?

해결책

Profile docs on the web have always been excessively cached, and I believe this is still the case with XPages. Most likely, what you'll see is that some requests will get the new value while others won't until the cache is fully refreshed after some arbitrary amount of time.

다른 팁

I actually like profile documents. However the way to use them is in a synchronized function that checks for an ApplicationScope variable and reads that one. If it is not there load from the profile. Write back immediately. So you super cache it.

To agree with the previous 2 answers. Do not use profile documents in xpages. The cache is refreshed when the HTTP task is refreshed. This is unacceptable in most environments. I would use another method like applicationScope to set those values.

But if you are ok with having to restart HTTP everytime this entry changes then go ahead and use profile docs in xPages...

I agree with Jesse. Caching is usually a big problem with with profile document. When we switched from Notes to XPage Environment we always had the same problem.

The solution is that you could create an simple agent for creating profile documents and then create a view to handle the same.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top