Kbase P160448: Buffer-level callbacks see wrong record during recursive fill
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  2/23/2010 |
|
Status: Unverified
SYMPTOM(s):
Buffer-level callbacks see wrong record during recursive fill
Callback procedure uses static buffer references
Buffer in AFTER-ROW-FILL callback procedure shows different record from the one just added to the temp-table
Buffer in AFTER-ROW-FILL callback shows record that was added earlier in the FILL() process
FACT(s) (Environment):
All Supported Operating Systems
OpenEdge 10.x
CAUSE:
This is a product limitation.
What happens is the following:
- During a recursive fill, only the top-level of the recursion will use the buffer which is bound to the dataset. Each lower level of recursion uses it's own buffer which will be cloned from this top-level buffer.
- When the buffer is cloned for a new level of recursion, any callback associations are cloned with it. The actual callback procedures are NOT cloned, just the references.
- The static reference in the callback procedure will be resolved to the buffer which is bound to the dataset at compile time. This is not re-evaluated at runtime when the recursion is handled and the cloning takes place.
The end result is that while the callback fires for each buffer on every level in the recursion, the callback procedure invoked will always refer to the record in the top-level buffer.
FIX:
Workaround:
Replace the static buffer references in the callback procedure with dynamic references to the SELF system-handle. SELF will point to the actual buffer for which the callback is executed.
Use of short-hand notation for field references is highly recommended in this case, as it minimizes the effective code changes.