This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



May 31, 2012, 2:14 PM
9 Posts

XPage loses data on Full Update (sometimes!)

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: refresh,lost,data,missing,update
  • Replies: 2
 I hope someone can help me solve a very serious problem we face at the moment with a business critical application losing data when a user works in it. 

This happens randomly - I have never reproduced this but the users are in the system a lot more than me. 

A document is created with a load of fields on it, and there are 2 rich text fields. We're using Domino 8.5.3 - there are no extension lib controls in use. The document has workflow built in, and all validation is done by a SSJS function called from the data query save event.  There is an insane amount of logging to the sessionscope.log and also this is (now) captured for each user in a notes document so I can review what they are doing. 

Sometimes, a user gets to a workflow step where they have to fill in a Rich Text field and make a choice in a dropdown field, then they submit the document with a workflow button. When  the workflow button is pressed (does a Full Update) some client side JS runs first 

    // Process any autogenerated submit listeners
    if( XSP._processListeners ){ // Not sure if this is valid in all versions of XPages
    XSP._processListeners( XSP.querySubmitListeners, document.forms[0].id );
    }

(I added this to try and prevent the RTF fields losing their values after reading a blog but so far it's not working)

then the Server-side event runs and calls view.save() to trigger QS code (for validation) and PS code to run the workflow agent on the server. 

95% of the time, this works fine.

5% of the time however, the page refreshes all the changes made, both to the RFT field (CKEditor) and the dropdown field are reloaded as they were previously, with no content. It's like the save hasn't happened, and the Full Update button has decided to work like a page refresh instead of a submit. 

Under normal circumstances, the log shows that when a workflow button is pressed, the QuerySave code starts and returns True. Then the ID of the workflow button pressed is logged (so I can see which ones are being used when I am reviewing problems), then the PostSave code starts and finally returns true. 

When there is a problem, The QuerySave event runs, returns true if the validation has passed, or false if it's failed, and then it stops. The ID of the workflow button is also logged. But the code should continue by calling the PostSave function if the QuerySave returns true - it doesn't even log that it's starting the PostSave function.

And to make matters worse, after the failure to call the PostSave code, the next thing that is logged is the beforePageLoad event running and this apparently reloads the page, which hasn't got the recent edits on it, and so the users loses all the information they have typed! 

This has to be the most annoying problem I've ever encountered with XPages as I can find no reason why a successful QuerySave (or even a failure because mandatory fields weren't filled in) would cause the page to refresh like this and lose the content. Please please can someone help point me in the right direction?? 

Jun 2, 2012, 8:35 AM
135 Posts
Re: XPage loses data on Full Update (sometimes!)
I've had similar problems with 8.5.1 and based on my experiences the problem can be caused by:
  1. Session timeout. This can be set in db properties. Application timeout should probably be at least as much.
  2. Multiple browser tabs open to same XPage. This can cause problems which are explained in "XPages portable command guide" book.
  3. Keeping pages in memory. I'm not sure if this has any effect but when I see this problem I select setting "Keep pages on disk". This might prevent Domino from losing the XPage from memory.

- Panu

 
  
Jun 12, 2012, 3:27 PM
9 Posts
Re: XPage loses data on Full Update (sometimes!)
  Thanks Panu
 
I have the KeepSessionAlive control on the page - thought that would help with session timeouts. It does appear to prevent me having to log in to the application if I leave the page open all day so I guess that's working. 
 
I recently got the Portable Command Guide book so I'll have a read through that.  I don't believe the users are looking at the same document in multiple windows in this instance, but there are functions to open up separate new documents in the same application in new tabs/windows - not sure if this will mess things up. 
 
And we have the setting to keep only the current page in memory at the moment after users reported a bug with adding images to the CKEditor and them not being available to other users when they looked at the same document. The image would only display for the user that uploaded it.
 
I'll keep trying things!  

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal