Concurrent formula processing of the same field by two different users

My action button formula is no longer working in an application that has been in use for 1.75 years. Our Servers and Client were upgraded to R6.5.1 from R5.0.8 around October 2004 in November of 2004 My problem occured. My formula sets a value in a field (“A”) on a form and gets a value from the same form different field (“B”). The purpose of the first @setDocField, (“A”), is to prevent concurrent access to the second field (“B”) on the form untill the action button formula completes it’s processing.Prior to October 2004 this process worked, now it doesn’t. Here is a copy of the Action button formula.

@Command([EditDocument] ; “1” );

@Command([ViewRefreshFields]);

A1 := @GetDocField ( “DocUNID” ; “A” );

A2 := @If ( A1 = 1 ; @Prompt([Ok] ; “Number” ; “Please Wait Five Seconds and Try Again”) ; 0 );

@If ( A2 = 0 ; @SetDocField ( “DocUNID” ; “A” ; 1) ; @Return(“”) );

F1 := @GetDocField ( “DocUNID” ; “B” );

F2 := F1 + 1;

FIELD Number := F2 ;

@SetDocField ( “DocUNID” ; “B” ; F2 );

@SetDocField ( “DocUNID” ; “A” ; 0 ) ;

This action button fromula is used to prevent the number in “B” being given to another user preforming the same action button formula at the same time. Field “A” should lock the second user out untill the formula completes its update of the New “B” value.

I welcome any thoughts.

Subject: Concurrent formula processing of the same field by two different users.

Domino 6 implements automatic document locking on the same server. Your code probably runs into a problem when the two users are trying to get the concurrent handles on the back end to read your sequence number.

The first question I’d ask is: do you really need to assign constant sequential numbers for this? People do this kind of thing all the time, and it’s very rarely actually necessary to have documents labels 1, 2, 3… n. What might be important is to assign every document a unique identifier, but there are many ways to accomplish that. Even if what you need is sequential numbers, do they necessarily have to increment by one? Otherwise, and offset from a constant time/date would probably do.