Skip to content

Manage the transaction envelope

This operation exposes the transaction-boundary hooks inherited by PolicyAppManager. The hooks are present for completeness, but the library's write path is permanently disabled.

Field Value
Operation ID OP-09
Trigger Framework asks the manager to start or stop a transaction
Inputs Portal transaction state and commit/rollback intent
Outputs Idempotent begin or end transaction behavior
Primary components PolicyAppManager.OnTransactionStart, OnTransactionStop, OnWrite, Write
Entry point Application\SAIF.Application.Policy\PolicyAppManager.vb

Steps

  1. When transaction start is requested, check DPI.TransactionPending.
  2. If no transaction is pending, call DataLayer.DAL.BeginTransaction(DPI.PortalID).
  3. When transaction stop is requested, check DPI.TransactionPending again.
  4. If a transaction is pending, call DataLayer.DAL.EndTransaction(DPI.PortalID, inCommit).
  5. Return False from OnWrite so callers never execute a write path through this manager (BR-128).
  6. Mirror the same read-only behavior through Write() by delegating to OnWrite and returning False.

Process flow

The following diagram visualizes transaction guarding.

flowchart TD
    Start([Transaction boundary requested]) --> Kind{Start or stop?}
    Kind -->|Start| Pending{Transaction pending?}
    Pending -->|No| Begin[Begin transaction]
    Pending -->|Yes| Skip1[Skip]
    Kind -->|Stop| Pending2{Transaction pending?}
    Pending2 -->|Yes| End[End transaction]
    Pending2 -->|No| Skip2[Skip]
    Begin --> Done([Return read-only manager])
    Skip1 --> Done
    End --> Done
    Skip2 --> Done

Failure and edge-case behavior

  • Because BR-128 disables writes, these hooks primarily guard against accidental nested transaction changes rather than enabling a real write workflow.

Sources

  • Application\SAIF.Application.Policy\PolicyAppManager.vb