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


Jan 9, 2014, 8:32 PM
20 Posts

Here is simple LotusScript that easily shows future date issue.

  • Category: Domino Server
  • Platform: All Platforms
  • Release: 9.0
  • Role: Developer
  • Tags: LotusScript future date problem
  • Replies: 4

I have the below lotus script that anyone can use to see the problem.  All you need to do is create a new database with a single document in it.  Add this LotusScript agent and then run it.  It will look for a document and if one exist it will then check for the field called test.  If it does not exist it will add it.  Next it uses a loop changing the field value from 1 to 0 or 0 to 1 and then save the document causing a bunch of writes in a short period of time.  When these events occur very fast in microseconds the modified date will begin going into the future.  Does IBM plan to resolve this issue so that the modified date is accurate?  Thank you.

 

Sub Initialize
      On Error Resume Next
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim dc As NotesDocumentCollection
      Dim doc As NotesDocument
      Dim answer As Integer
      Dim strItemValue As Variant
      Dim Counter As Integer
       
      Set db = session.CurrentDatabase
      Set dc = db.UnprocessedDocuments
      Set doc = dc.GetFirstDocument
 
   'We first need to check and make sure we have a document
   'If not we exit.
      If(doc Is Nothing) Then
             Exit Sub
      End If
       
      'Now let's check to see if this doc has the test field
      'We are using the test field so it should not.  If it
      'does have this field then we really should not mess with
      'this document and exit.  The field may have been for
      'something else.  If not then we will add it.
      If (doc.Hasitem("test")) Then
             Call doc.Save(False, True)
             Exit Sub
      Else
             Call doc.Appenditemvalue("test", "0")
             Call doc.Save(False, True)
      End If
       
       
      'Now we can start our loop to look at test to see if it
      'equals 0, if so we change it to 1.  If not we change
      'change it to 0.  This loops 10,000 times.
      Counter = 0
      Do While (Counter < 10000)
             strItemValue = doc.Getitemvalue("test")
             If (strItemValue(0) = "0") Then
                    Call doc.ReplaceItemValue("test", "1")
                    Call doc.Save(False, True)
             Else
                    Call doc.ReplaceItemValue("test", "0")
                    Call doc.Save(False, True)
             End If
             
             Counter = Counter +
1

      Loop
       
      'Now we can remove the field because no longer needed.
      Call doc.RemoveItem("test")
      Call doc.Save(False, True)
End Sub
 

Jan 29, 2014, 4:44 PM
20 Posts
Anyone seen this before and know when this will be fixed?
Jan 29, 2014, 5:38 PM
107 Posts
Seen this before, but doubt it will ever be fixed.
The same happens when lots of new documents are created in short time.

It's related to the anatomy of Note IDs; see:
http://www-12.lotus.com/ldd/doc/tools/c/6.5/api65ug.nsf/85255d56004d2bfd85255b1800631684/00d000c1005800c985255e0e00726863

For UNIDs and OIDs to be unique, the interval of time between two documents being created or a specific document being saved must never become shorter than one tick of Notes' internal clock. Since current computers are able to create and save documents much faster, Notes advances its internal clock to force unique UNIDs and OIDs. It's a huge kludge, let's face it. But since the whole concept is so fundamental to Notes, I doubt this will ever be fixed.

Just my 2 cents...
Jan 15, 2015, 8:03 AM
28 Posts
And if I may ask, what is your code trying to achieve ?
For a - lets say - business or user perspective ?

By the look of your code, it sounds as you are trying to invent some kind of Locking mechanism.
Aug 3, 2018, 7:40 PM
20 Posts
response to Peter

I wrote this code only for the purpose to show that when many writes occur all at once that the time/date will go into the future.  It has no other purpose.  Thanks to all responses.


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