Skip to content

SQL-MVC-002: Retrieve cross-application context

Reads all context rows a different source application left behind for the current session, explicitly excluding rows already belonging to the current application. clsContext.RetrieveContext calls this, then immediately deletes the returned rows via SQL-MVC-004 — a read-then-consume pattern that implements a one-time cross-application state hand-off.

Classification

Field Value
SQL ID SQL-MVC-002
Operation type Read
Execution method Inline SQL (SqlCommand + SqlDataAdapter.Fill)
Database SQL Server (catalog NETFRAMEWORK)
Schema [unqualified]**
Command type Text
Business object N/A (Application layer)
Criteria property N/A (Application layer)
Lifecycle method N/A (Application layer)
Application class clsContext.clsContextRepository.Retrieve(SourceAppName, CurrentAppName, inSessionID) — called from clsContext.RetrieveContext

Parameters

Parameter Direction Type Max length Description
@AppName Input SqlDbType.VarChar 50 Source application name to match; bound from SourceAppName.
@SessionID Input SqlDbType.VarChar 50 Session identifier to match; bound from inSessionID.
@CurrentApp Input SqlDbType.VarChar 50 Current (calling) application name, used to exclude rows via not AppName=@CurrentApp; bound from CurrentAppName.

Tables

Table Access Columns used
Context SELECT ID, AppName, SessionID, ContextName, ContextValue, UpdateDate

Sample SQL

-- Retrieve context rows left by a different source application for this session
SELECT
  ID,
  AppName,
  SessionID,
  ContextName,
  ContextValue,
  UpdateDate
FROM Context
WHERE AppName = @AppName
  AND SessionID = @SessionID
  AND not AppName = @CurrentApp

Operations and processes

Business rules

Note: Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • SAIF.Presentation.Web.MVC\clsContext.vb