Kbase P184033: SAVE-ROW-CHANGES does not copy dataset changes back to the client in the event of conflict.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/03/2011 |
|
Status: Unverified
SYMPTOM(s):
SAVE-ROW-CHANGES does not copy dataset changes back to the client in the event of conflict.
When error 11913 occurs database changes made by another user are not copied back to the ProDataSet.
SAVE-ROW-CHANGES found <name> record with conflicting change by another user. (11913)
FACT(s) (Environment):
MERGE-BY-FIELD is true and PREFER-DATASET is false.
Structured error handling is being used to catch any errors from the update. For example:
DO TRANSACTION ON ERROR UNDO, THROW:
beforeBuffer:FIND-FIRST().
beforeBuffer:SAVE-ROW-CHANGES ().
CATCH e AS Progress.Lang.SysError :
MESSAGE "ERROR!!!!!!!!!" SKIP
e:GetMessageNum(1)
VIEW-AS ALERT-BOX INFO BUTTONS OK.
IF e:GetMessageNum(1) = 11913 THEN /* conflict */
DO:
/* Do some Error handler processing */
END.
ELSE
MESSAGE "Update Error : " e:GetMessage(1) VIEW-AS ALERT-BOX.
END CATCH.
END.
A change is being made in a ProDataSet copy of a database field, but after the ProDataSet has been FILLed, another change has been made and saved by a different user to the same database field. This creates an update conflict when the ProDataSet data is being written to the database.
All Supported Operating Systems
OpenEdge 10.2x
CAUSE:
The structured error handling is backing out the transaction and this includes the changes that have been copied across from the database. Because of the functionality of SAVE-ROW-CHANGES undoing the transaction at a higher level with structured error handling is difficult to achieve.
FIX:
Use more traditional methods of catching the error with the ERROR-STATUS system handle and GET-MESSAGES. For example:
DO TRANSACTION:
beforeBuffer:FIND-FIRST().
beforeBuffer:SAVE-ROW-CHANGES () NO-ERROR.
END.
IF beforeBuffer:ERROR AND ERROR-STATUS:NUM-MESSAGES > 0 THEN
DO i = 1 TO ERROR-STATUS:NUM-MESSAGES:
MESSAGE "Error : " beforeBuffer:ERROR SKIP
"Rejected : " beforeBuffer:REJECTED SKIP
"Message : " ERROR-STATUS:get-message(i)
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.