Consultor Eletrônico



Kbase P19414: VST _myConnection provides user number for a connected database as well as PID of session
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   25/03/2011
Status: Verified

GOAL:

How to retrieve the user number for a connected database for the current 4GL session ?

GOAL:

How to know in 4GL the PID of the Database server to which the current remote user is connected ?

GOAL:

How to retrieve the user PID of current 4GL session when connected to a database?

GOAL:

What is the purpose of the _Mycon-UserID field?

GOAL:

When _myconnection was introduced?

GOAL:

In which version was _myconnection introduced?

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.x
OpenEdge 10.x

FIX:

The Virtual System Table _MyConnection introduced in Version 9.0A has one record for the connection to a database, and provides the following fields:

_MyConn-NumSeqBuffers : Number of private read-only buffers currently allowed.
_MyConn-Pid : This user's process ID.
_MyConn-UsedSeqBuffers: Number of private read-only buffers currently in use.
_MyConn-UserId: The user's user ID.

When connected to a single database the following code will return the user number for the current 4GL session:


FIND _MyConnection.
DISPLAY _MyConn-UserId.When connected to multiple databases, this table should be queried with the DatabaseName: FIND <MyDatabase>._connect as per example below:

DEF VAR servernum AS INTEGER NO-UNDO.
FIND FIRST _Myconnection.
FIND FIRST _connect WHERE _connect._connect-pid = _Myconnection._myconn-pid.
ASSIGN servernum=_connect._connect-server.
FIND FIRST _connect WHERE _connect._connect-usr = servernum.
DISPLAY _connect._connect-pid.