Method TryEndOnTransientFailure
- Namespace
- MailFathom.Application.Persistence
- Assembly
- MailFathom.Application.dll
TryEndOnTransientFailure(Exception)
Ends this session on a failure a write raised before the commit, where the database may not raise it again.
bool TryEndOnTransientFailure(Exception failure)
Parameters
failureExceptionThe failure a write joined to this session raised.
Returns
Remarks
A write joined to a session does not only stage changes: it issues statements of its own, and a set-based update or a row lock has already reached the server long before anything is committed. The failure of one of those never passes through the commit, so this is where it is classified instead — by the session, which is the only side of this contract that knows what the provider raised, and for the caller above it, which is the only side that holds the body a replay would run again. What a staged write reached that was not the database is somebody else's dependency and answers false. The session is invalid afterwards either way.
The default answers false, because a session with no database beneath it has no provider failure to recognize and nothing to end: what such a session raised is the caller's to report rather than a race with a connection to replay.