Provision a data portal and register it by key¶
Constructs an Oracle or SQL Server data portal from caller-supplied connection properties and registers it in the manager's DPI library under a lower-cased key.
| Field | Value |
|---|---|
| Operation ID | provision-a-data-portal-and-register-it-by-key |
| Trigger | Derived manager's OnCreateDataLayer() implementation |
| Inputs | DBUser, Database, Server properties; a portal key string |
| Outputs | An IDataPortalInfo registered in the DPI library under the lower-cased key |
| Primary components | ApplicationDataAccess.CreateOraclePortal, ApplicationDataAccess.CreateSQLServerPortal, AppManagerBase.InjectDPI |
| Entry point | SAIF.Application/ApplicationDataAccess.vb, SAIF.Application/AppManagerBase.vb |
Steps¶
- Caller sets
DBUser,Database, and (SQL Server only)Serveron theApplicationDataAccessinstance; optionally setsBatchID. CreateOraclePortal(inKey)/CreateSQLServerPortal(inKey)copies those values onto theclsEnvironmentand setsDBMSTypetoOracleorSqlServerrespectively.ClientIDis seeded from the DAL's client id, then overwritten withBatchIDwhenBatchID.Trim.Length > 0(BR-APP-007).- A
clsMSOracleDataPortal(m_Env)orclsSQLDataPortal(m_Env, True)is constructed and handed toDAL.AddDataPortal(portal, portal.PortalID & inKey). - The returned
IDataPortalInfois added tom_DPILibraryunderinKey.ToLower(BR-APP-008); re-using a key via the create methods raises anArgumentExceptionrather than replacing the entry, whileInjectDPIsilently ignores a duplicate key.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start(["OnCreateDataLayer<br>called"]) --> SetProps["Set DBUser, Database,<br>Server, BatchID"]
SetProps --> Create["CreateOraclePortal or<br>CreateSQLServerPortal"]
Create --> ClientId["Resolve ClientID<br>from BatchID or DAL"]
ClientId --> Build["Construct<br>clsMSOracleDataPortal or<br>clsSQLDataPortal"]
Build --> Register["AddDataPortal +<br>register under key"]
Register --> End(["Portal ready<br>for use"])
Failure and edge-case behavior¶
- Re-registering a DPI key through
CreateOraclePortal/CreateSQLServerPortalraisesArgumentException; the same key viaInjectDPIis silently ignored. - No SQL is issued anywhere in this operation — it only establishes connection context for the business layer.