Created
March 21, 2014 13:54
-
-
Save gregoryyoung/9686774 to your computer and use it in GitHub Desktop.
hmm lots of comments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private bool DetectConcurrencyViolations(CheckpointTag expectedTag) | |
{ | |
//NOTE: the comment below is not longer actual | |
// Keeping it for reference only | |
// We do back-read all the streams when loading state, so we know exactly which version to expect | |
//TODO: if the following statement is about event order stream - let write null event into this stream | |
//NOTE: the following condition is only meant to detect concurrency violations when | |
// another instance of the projection (running in the another node etc) has been writing to | |
// the same stream. However, the expected tag sometimes can be greater than last actually written tag | |
// This happens when a projection is restarted from a checkpoint and the checkpoint has been made at | |
// position not updating the projection state | |
return expectedTag != _lastCommittedOrSubmittedEventPosition; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment