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 17, 2011, 8:52 PM
47 Posts

Document Locking on xpages with partial refresh

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: document lock partial refresh
  • Replies: 2
 Hi folks, back to the well again... hey I work alone so I need someone to talk to...
 
I am trying to get document locking to work in a situation where I have my documents in read mode (NoteXspDocument) and I can change the mode to edit with a partial refresh... that works fine. Now trying to get the document locking working (which is already turned on for the DB, it is an older design I am updating). There isn't a method on the NotesXspDocument for locking and if I use the backing document retrieved with getDocument(), I wind up with replication/save conflicts. Probably because the in-memory document sees the on disk document as being modified by the lock() call.
 
So, I'm a bright fella, I found out a long time ago that locking the document consists of adding $Writers and $WritersDate to the document (clearing a lock by removing them works just fine). I figure I can set the values myself through the NotesXspDocument... close but no guitar.  document.lockHolders doesn't return the value of $Writers, and I can still get a lock against a 'locked' document (the delete code has to get a lock).
 
Anyone know how to either get my lock to be a real lock that will be recognized, or even preferably a way to lock the document through the in-memory NotesXspDocument which won't cause conflicts? Remember this is via partial refresh so I can't mess with the backing document in any way that the in memory document won't know about and I can't do a redirect. 
 
AtDhVaAnNkCsE
 
Rich 
May 23, 2011, 8:46 PM
64 Posts
I locked mine in beforePageLoad...
- But that won't work for a partial refresh, you have to do a full reload just like I had to.  If that's tenable for you, it works.
 
Hope this helps...
May 24, 2011, 3:31 PM
47 Posts
Re: I locked mine in beforePageLoad...
 No, I think I have to stick with partial refreshes and my 'unofficial' locks for now.
 
It sure would be nice if the NotesXspDocument class had the lock() and unlock() methods. While I'm wishing, might as well ask for queryModeChange and postModeChange events on a document data source. 
 
Rich 

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