Consultor Eletrônico



Kbase P18107: Stale Handles Explained
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   02/03/2005
Status: Unverified

GOAL:

Stale Handles Explained

GOAL:

What is a Stale Handle?

FACT(s) (Environment):

Progress 9.1x
OpenEdge 10.x

FIX:

A handle is an object that represents a resource.
Handles are used when the resource cannot be represented directly. For example, a file handle is an object passed between a process and the OS in order to access a file, because the file itself cannot be represented.

Relevance to memory management:
In memory management, a handle is an object that represents another object. Handles are usually used because the object itself needs to be moved in memory, or even swapped out to disk. The program therefore cannot know the address of the object.
Good Operating Systems reuse memory. A new object could be created that uses the old handle. If your variable lives longer than your objects, set it to unknown.

To check if a handle is valid you need to check:
VALID HANDLE
Handle:TYPE

Handle:UNIQUE-ID. A value that Progress guarantees is unique within the Progress session.

Applies To:
Buffer Object Handle, Buffer-field Object Handle, Query Object Handle, THIS-PROCEDURE System Handle (and all procedure handles), X-document Object Handle, X-noderef Object Handle.
A Handle is machine dependent and cannot be passed from one machine to another, since he points to a portion of memory of the machine that created it initially.