-
-
Save elliotchance/52d19775e2b334a5993509bac961b8be to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ReadCommittedTransaction(Transaction): | |
def record_is_locked(self, record): | |
return record['expired_xid'] != 0 and \ | |
row['expired_xid'] in self.table.active_xids | |
def record_is_visible(self, record): | |
# The record was created in active transaction that is not our | |
# own. | |
if record['created_xid'] in self.table.active_xids and \ | |
record['created_xid'] != self.xid: | |
return False | |
# The record is expired or and no transaction holds it that is | |
# our own. | |
if record['expired_xid'] != 0 and \ | |
(record['expired_xid'] not in self.table.active_xids or \ | |
record['expired_xid'] == self.xid): | |
return False | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment