Skip to content

Save (Write)

Public override on ClaimAppManager that wraps subclass save logic in a transaction lifecycle.

Field Value
Operation ID OP-CLM-004
Trigger Caller requests persistence via Write().
Inputs None (operates on in-memory state built up by the concrete subclass)
Outputs Boolean (success/failure)
Primary components ClaimAppManager.Write, OnTransactionStart, OnTransactionStop
Entry point SAIF.Application.Claim\ClaimAppManager.vb

Steps

  1. Call OnTransactionStart() — begins an Oracle DPI transaction if Not DPI.TransactionPending (DataLayer.DAL.BeginTransaction(DPI.PortalID)).
  2. Call OnWrite() — implemented by the concrete subclass, not in this library; save logic is not traceable from this library's source**.
  3. On success or failure, OnTransactionStop(WriteResult) runs in a Finally block — commits or rolls back (DataLayer.DAL.EndTransaction(DPI.PortalID, inCommit)) based on the write result.
  4. On exception during OnWrite(): OnTransactionStop(False) is explicitly called (forcing rollback) before the exception is re-thrown; the Finally block's OnTransactionStop(WriteResult) then also executes per VB.NET Try/Catch/Finally semantics, meaning OnTransactionStop may be invoked twice on the exception path*. DPI.TransactionPending is checked inside OnTransactionStop/OnTransactionStart so this is not expected to be observably harmful, but is noted as an implementation nuance.

Process flow

flowchart TD
    Start([Write called]) --> TxStart[OnTransactionStart]
    TxStart --> OnWrite[OnWrite<br>subclass-implemented]
    OnWrite --> Exception{Exception?}
    Exception -->|Yes| ForceRollback[OnTransactionStop False]
    ForceRollback --> Rethrow([Re-throw exception])
    Exception -->|No| Finally[OnTransactionStop WriteResult<br>Finally block]
    Rethrow --> Finally
    Finally --> End([Return WriteResult])

Failure and edge-case behavior

  • Exception during OnWrite(): forced rollback, then OnTransactionStop may run twice per VB.NET Try/Catch/Finally semantics*.

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • SAIF.Application.Claim\ClaimAppManager.vb