Write claim application changes¶
Write() wraps the subclass-specific save logic in an Oracle transaction so that either all pending changes commit together or none of them do. It is the transactional counterpart to Retrieve claim application data.
| Field | Value |
|---|---|
| Operation ID | OP-AC-04 |
| Trigger | Caller calls Write() on an active ClaimAppManager subclass instance |
| Inputs | Pending in-memory changes accumulated by the subclass since the last save |
| Outputs | Boolean commit/rollback result; committed or rolled-back Oracle transaction |
| Primary components | ClaimAppManager.Write, ClaimAppManager.OnTransactionStart, ClaimAppManager.OnWrite, ClaimAppManager.OnTransactionStop, IDataPortalInfo |
| Entry point | Application\SAIF.Application.Claim\ClaimAppManager.vb |
Steps¶
Write()initializes a localWriteResulttoFalse.Write()callsOnTransactionStart()before attempting any subclass save logic.OnTransactionStart()checksDPI.TransactionPending; if it is false, it callsDataLayer.DAL.BeginTransaction(DPI.PortalID)to open a new Oracle transaction. If a transaction is already pending, no new transaction is started.- Inside a
Tryblock,Write()callsOnWrite()and assigns its result toWriteResult. OnWrite()is abstract inClaimAppManager; the concrete subclass performs its own business-object save calls here.- On an exception during
OnWrite(): theCatchblock callsOnTransactionStop(False)(forcing a rollback) and then re-throws the caught exception viaThrow ex, which resets the original stack trace to this catch block rather than preserving the original throw location.* - The
Finallyblock callsOnTransactionStop(WriteResult)unconditionally, whether or not an exception occurred. OnTransactionStop(inCommit)checksDPI.TransactionPending; if a transaction is pending, it callsDataLayer.DAL.EndTransaction(DPI.PortalID, inCommit), committing wheninCommitis true and rolling back when it is false.- Because the
Catchblock already calledOnTransactionStop(False)on failure, theFinallyblock's subsequent call finds no transaction pending (from the perspective ofDPI.TransactionPending) and is effectively a no-op on the exception path.* Write()returnsWriteResultas the overall success indicator.
Process flow¶
The following diagram visualizes the transaction-wrapped save sequence, including the exception path.
flowchart TD
Start([Caller invokes Write]) --> TxStart[OnTransactionStart:<br>begin transaction if none pending]
TxStart --> OnWrite[OnWrite in subclass]
OnWrite -->|Success| SetResult[WriteResult = OnWrite result]
OnWrite -->|Exception| Rollback[OnTransactionStop False;<br>rethrow exception]
SetResult --> Finally[Finally: OnTransactionStop WriteResult]
Rollback --> Finally
Finally --> Commit{WriteResult True?}
Commit -->|Yes| Committed([Transaction committed])
Commit -->|No| RolledBack([Transaction rolled back<br>or exception propagates])
Failure and edge-case behavior¶
- If
OnWrite()throws, the transaction is rolled back immediately in theCatchblock and the original exception is re-thrown to the caller — callers must handle the propagated exception themselves;Write()does not swallow it. - Re-throwing with
Throw ex(rather than a bareThrow) resets the stack trace, which can make root-cause diagnosis harder for callers inspecting the exception.* - If
OnTransactionStart()finds a transaction already pending (DPI.TransactionPending = True), it does not begin a new one — nestedWrite()calls share the same outer transaction rather than each managing their own.* OnWrite()has no base-class implementation; a subclass that does not override it will haveWriteResultremain at its defaultFalse, and the transaction will always roll back.*
Related documentation¶
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Sources¶
Application\SAIF.Application.Claim\ClaimAppManager.vb