Consultor Eletrônico



Kbase P142569: How to find transaction ID for current connection ?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   09/03/2009
Status: Unverified

GOAL:

How to find transaction ID for current connection ?

GOAL:

How to find the databse's transaction ID for the current transaction ?

GOAL:

How to determine which transaction is in use by which client ?

FACT(s) (Environment):

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

FIX:

The _Myconnection Virtual System Table (VST) will provide the details on a specific connection to the database from an ABL client.

The _connect VST will provide the transaction ID for the open connections in the _connect-Transid field.

This will have one of the following values:
- If a connection is currently unused, the _connect-transID field will be ? ( along with the other fields in the record)
- If a connection is in use but does not have a transaction active, the _connect-transID will be 0
- If a connection is in use and has a transaction active, the _connect-transID will be a number other than 0. This will be the actual transaction ID on the database side.

These two VSTs can be joined to identify which transaction ID is used for the current database connection. The code below shows an example on how this can be done:


DO TRANSACTION:

FIND _myConnection NO-LOCK.
FIND _connect WHERE _connect._connect-usr = _myConnection._myConn-UserID NO-LOCK.
MESSAGE _connect._connect-Transid VIEW-AS ALERT-BOX INFO BUTTONS OK.

PAUSE.

END.