UNDO scope and relationship to a FINALLY block
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
FINALLY executes. Buffers scoped to
the associated block of the FINALLY block are not available
when the FINALLY block executes. This is because either the
buffer was undone and released, or committed and released.
If a buffer
referenced in a FINALLY block is referenced outside of the
associated block, then the scope of that buffer is the smallest enclosing block outside of
the associated block that encompasses all references to the buffer. Therefore, these buffers
are available to the FINALLY block.
The FINALLY block itself is an undoable block with
implicit ON ERROR UNDO, THROW error handling. You cannot
explicitly override the ON ERROR directive for a FINALLY block.
A statement that raises
ERROR or STOP within a
FINALLY block causes the following to occur, unless the
condition is handled within the block:
UNDOtheFINALLYblock if it contains a transaction, which would be uncommon.-
LEAVEthe associated block. -
THROWthe condition to the block enclosing the associated block, or to the caller if there is no outer block.