Kbase P103317: Assigns unique value to key field in write trigger and ends up with duplicate records
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  15/04/2005 |
|
Status: Unverified
FACT(s) (Environment):
Progress 9.x
SYMPTOM(s):
Assigns value to database field in write trigger
Value is unique within the entire database table
Randomly gets errors indicating that the write trigger tried to assign a value that already exists (value = 0)
CAUSE:
Write trigger sits in a REPEAT block trying to find the last record in the table with an exclusive lock. Eventually the REPEAT block is exited due to the 4GLs automatic endless loop protection mechanism and this causes the value being assigned to the unique key field to become zero which causes the error
FIX:
Modify the write triggers code and replace the REPEAT block with a DO block