Kbase 20363: VALID-HANDLE, Persistent Procedures, UNIQUE-ID and Win 2000
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  3/12/2008 |
|
Status: Unverified
FACT(s) (Environment):
Windows NT 32 Intel/Windows 2000
Progress Version 9.0x
Progress Version 9.1A
Progress Version 9.1B
SYMPTOM(s):
VALID-HANDLE function returns erroneous results.
Procedure has no entry point for . (6456)
Procedure adeuib/_vldwin.p has no entry point for GetAttribute. (6456)
CAUSE:
In some circumstances (for instance when you try to make a call to an internal procedure within one of the persistently started procedures), the following error might occur much more frequently under Windows 2000:
Error (6456): Procedure <ProcedureName.w> has no entry point for <InternalProcedureName>.
Windows 2000 management of handles forces the IF VALID-HANDLE statement to return a TRUE event if the handle now points to a different procedure. What happens is that the handle variable points to a valid handle as it's currently in use, but due to the fact that the handle has been re-used it points to the wrong procedure.
NOTE: This behavior is encountered much more frequently under Windows 2000, but also under Windows NT. The VALID-HANDLE function itself, however, behaves properly on all platforms.
FIX:
In your application, you must implement the UNIQUE-ID attribute or always clear the persistent procedure handle after deleting the procedure.
Solution 1:
Declare a variable in which you are going to store the unique identification of the handle and check for it's validity and uniqueness.
For example:
DEFINE VARIABLE hPersProc AS HANDLE NO-UNDO.
DEFINE VARIABLE hUniqueID AS INTEGER NO-UNDO.
ON CHOOSE OF Btn1 IN FRAME F-MAIN
DO:
IF NOT VALID-HANDLE(hPersProc) OR hUniqueID <> hPersProc:UNIQUE-ID THEN
DO:
RUN ProcedureName.w PERSISTENT SET hPersProc.
ASSIGN hUniqueID = hPersProc:UNIQUE-ID.
END.
ELSE
IF VALID-HANDLE(hPersProc) THEN
RUN InternalProcedureName IN hPersProc.
END.
Solution 2:
DELETE PROCEDURE hPersProc.
ASSIGN hPersProc = ?.
note:
Starting with V9.1C there is no more need to implement this way of checking the validity of the handle. From V9.1C the Handles pointers are no more returned by the OS but directly by Progress. Anyway if you have implemented before 9.1C in your code the UNIQUE-ID checking you do not need to remove it, this is now transparent for Progress.