Kbase P113488: SETUSERID() function causes session to crash in 10.1A.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/16/2008 |
|
Status: Verified
SYMPTOM(s):
SETUSERID() function causes session to crash in 10.1A
Stack trace from prowin32.exe reads:
dbut_utsetuid
Stack trace from _progres reads:
__funlockfile
scUseCanFields
scaccr
prodosetu
prosetuid
fdsetuid
fmESETUID
FACT(s) (Environment):
Application calls one of the following statements or methods before invoking SETUSERID():
FIND CURRENT
<query handle>:GET-CURRENT()
DEFINE BROWSE with the ENABLE phrase.
One of the following conditions applies:
Running from r-code
Database schema was changed between application start and SETUSERID call
Client crashes with dbut_utsetuid in protrace
Running from uncompiled code (.p's) works fine.
OpenEdge 10.1A
All Supported Operating Systems
CAUSE:
Bug# OE00126005
CAUSE:
When running r-code, SETUSERID() tried to fetch some information from the r-code itself; under the given circumstances, this information was not present in the r-code and the session crashed as a result. When running uncompiled code, the r-code is not in memory yet and SETUSERID() retrieves the same information from the schema cache instead. This is why it works in this scenario.
FIX:
Upgrade to OpenEdge 10.1A01 or later.
The following is a list of possible workarounds:
- If you are still porting/testing your application on 10.1A and can rely on a 4GL Development license or greater, you can run without r-code for the programs invoked before SETUSERID(). Of course, this is not a viable solution in a production environment, where a 4GL Development license is generally not available.
- Change the FIND CURRENT <tableName> statement to:
DEFINE VARIABLE storeRecid AS RECID NO-UNDO.
ASSIGN storeRecid = RECID(<tableName>).
FIND <tableName> WHERE RECID(<tableName>) = storeRecid <lock phrase>.
or change the call to <queryHandle>:GET-CURRENT() to:
DEFINE VARIABLE iCount AS INTEGER NO-UNDO.
DEFINE VARIABLE hBuffer AS HANDLE NO-UNDO.
DEFINE VARIABLE storeRowid AS ROWID NO-UNDO.
DO iCount = 1 TO <queryHandle>:NUM-BUFFERS:
ASSIGN hBuffer = <queryHandle>:GET-BUFFER-HANDLE(iCount)
storeRowid = hBuffer:ROWID.
hBuffer:FIND-BY-ROWID(storeRowid, NO-LOCK).
END.
There is no substitute code in case you are using DEFINE BROWSE with the ENABLE phrase.