Using Following setting in Multi-User Environment
SET REFRESH TO 5,3
SET REPROCESS TO 5 SECONDS
Tablebuffering set to 5
CounteTbl has only 1 record with 1 Field N(6)
e.g. CounterTbl current value is 31
e.g. Both Users working on Sale Invoice and they both save invoice at same time User-1 first succeeded in locking CounterTbl and then advance the CounterTbl value from 31 to 32 and unlock CounterTbl but for User-2 after many many tries still Countertbl showing 31 instead of 32
What's wrong here ?
1. Lock counter table by Flock()
2. Lock Successfully then get present no of counter table
3. Update header and detail Sale tables with this counter no
4. Advance Counter No by 1 in counter table
5. llCntrSccss = TABLEUPDATE(0,.T.,'CounterTbl')
6. FLUSH IN CounterTbl
7. UNLOCK IN CounterTbl
SET REFRESH TO 5,3
SET REPROCESS TO 5 SECONDS
Tablebuffering set to 5
CounteTbl has only 1 record with 1 Field N(6)
e.g. CounterTbl current value is 31
e.g. Both Users working on Sale Invoice and they both save invoice at same time User-1 first succeeded in locking CounterTbl and then advance the CounterTbl value from 31 to 32 and unlock CounterTbl but for User-2 after many many tries still Countertbl showing 31 instead of 32
What's wrong here ?
1. Lock counter table by Flock()
2. Lock Successfully then get present no of counter table
3. Update header and detail Sale tables with this counter no
4. Advance Counter No by 1 in counter table
5. llCntrSccss = TABLEUPDATE(0,.T.,'CounterTbl')
6. FLUSH IN CounterTbl
7. UNLOCK IN CounterTbl