Kbase P133222: Temp-Table records may not be available after creation
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  02/12/2008 |
|
Status: Verified
SYMPTOM(s):
Newly created temp-table record is not available in other procedures
Temp-Table records may not be available after creation
** No <file-name> record is available. (91)
FACT(s) (Environment):
All Supported Operating Systems
Progress/OpenEdge Versions
CAUSE:
When a record is created in a temp-table in an internal procedure, that record may not be immediately available outside the scope of that procedure.
There is a transaction mechanism for temp-tables with indices even if they are defined with NO-UNDO. The procedure that creates or modifies the record is using the default buffer of the temp-table which is scoped to the full 4GL session. Thus, the newly created record is not available to other procedures until it is released or some other event causes the index assignment to complete.
- Using a buffer defined in the internal procedure that creates or modifies the records solves the problem because its scope is limited to the internal procedure. Once the internal procedure ends, the scope of the buffer is gone and the record is available outside.
- Using a transaction block or explicitly releasing the record solves the problem because that forces the implicit transaction to end at the scope of the transaction or when the release statement executes.
- Assigning some value aside from the default initial value to a unique index indicates tells the index assignment code that no other value is forthcoming and completes the index write.
- If there is no index to assign then the work is done and the record becomes immediately available.
FIX:
The most preferable way to handle this is to use the RELEASE statement to release the buffer after assignment. Below is a list of ways to avoid this behavior, in no particular order.
- RELEASE the temp-table buffer after assignment
- Define a transaction scope around the record creation/assignment
- Define a buffer within the internal procedure for the temp-table (thus avoiding usage of the default buffer)
- Define a unique default initial value which won't be assigned at runtime (e.g. ?)