Project

General

Profile

Bug #12024

_MyConnection: restrict to the current connection, and finish the remaining fields

Added by Greg Shah 15 days ago. Updated 15 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:

History

#1 Updated by Greg Shah 15 days ago

_MyConnection: restrict to the current connection, and finish the remaining fields

Project: Database

Problem

In the 4GL, _MyConnection holds exactly one record: the current session's own connection. Code relies on this with FIND FIRST _MyConnection to get its own user number (_MyConn-UserId), and uses that number to select its own records in other VSTs such as _UserTableStat (_UserTableStat-Conn = _MyConn-UserId) or _Connect.

The gap marking records the table as Partial on both sides:
  • Conversion: "a query over this table is converted, but it is not yet restricted to the current user's own connection the way the 4GL restricts it; narrowing it requires a conversion change".
  • Runtime: "the table is populated, but a user can currently see every other user's connection records rather than only their own; _myconn-numseqbuffers and _myconn-usedseqbuffers are stubs".

The current source suggests the restriction may already be in place, at least on H2. DDLGeneratorWorker (MY_CONNECTION_AUX) creates a view, meta_myconnection, over the table meta_myconnection_, filtered by my_conn_user_id = fwdSession_1(), with an INSTEAD OF trigger handled by persist/h2/UpdatableMyConnectionView. ConnectTableUpdater sets my_conn_user_id to the session id. So it is not known which of the recorded limitations still hold.

Work

  1. Establish the current state with testcases, with two or more sessions connected at the same time:
    • what FIND FIRST _MyConnection, FOR EACH _MyConnection and a dynamic query over it return in each session;
    • whether the converted query actually goes through the filtered view or reads the underlying table directly;
    • whether this holds for every way the metadata database can be configured, and on every dialect the metadata tables can live in.
  2. Restrict the table to the current connection wherever that is not already the case, so that every static and dynamic query returns only the session's own record.
  3. Make sure _MyConn-UserId is the same value that identifies the session in _Connect (_Connect-Usr) and _UserTableStat (_UserTableStat-Conn), so the joins 4GL code makes between these tables work.
  4. Check _MyConn-Pid against _Connect-Pid for the same session.
  5. Implement _MyConn-NumSeqBuffers and _MyConn-UsedSeqBuffers, or report a fixed value that matches what OpenEdge reports for a session with no sequence activity, whichever the OpenEdge behaviour supports.
  6. Update the gap marking for _myconnection and its fields.

Testcases

Each with an OpenEdge baseline:
  • one session: the record count, and every field of the record;
  • two concurrent sessions: each sees only its own record, and the user numbers differ;
  • _MyConn-UserId used to find the session's own records in _Connect and _UserTableStat;
  • a session that disconnects and reconnects.

Also available in: Atom PDF