-
-
Save elliotchance/933d96660288ea97cebf61c71df99d25 to your computer and use it in GitHub Desktop.
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
class SerializableTransaction(RepeatableReadTransaction): | |
def __init__(self, table, xid): | |
Transaction.__init__(self, table, xid) | |
self.existing_xids = self.table.active_xids.copy() | |
def record_is_visible(self, record): | |
is_visible = ReadCommittedTransaction.record_is_visible(self, record) \ | |
and record['created_xid'] <= self.xid \ | |
and record['created_xid'] in self.existing_xids | |
if is_visible: | |
self.table.locks.add(self, record['id']) | |
return is_visible |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment