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¶
- When transaction start is requested, check
DPI.TransactionPending. - If no transaction is pending, call
DataLayer.DAL.BeginTransaction(DPI.PortalID). - When transaction stop is requested, check
DPI.TransactionPendingagain. - If a transaction is pending, call
DataLayer.DAL.EndTransaction(DPI.PortalID, inCommit). - Return
FalsefromOnWriteso callers never execute a write path through this manager (BR-128). - Mirror the same read-only behavior through
Write()by delegating toOnWriteand returningFalse.
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.
Related documentation¶
Sources¶
Application\SAIF.Application.Policy\PolicyAppManager.vb