Remove the restoration state taken before a transaction began. Corresponds to a commit.
(self)
| 1139 | s._expire(s.dict, self.session.identity_map._modified) |
| 1140 | |
| 1141 | def _remove_snapshot(self) -> None: |
| 1142 | """Remove the restoration state taken before a transaction began. |
| 1143 | |
| 1144 | Corresponds to a commit. |
| 1145 | |
| 1146 | """ |
| 1147 | assert self._is_transaction_boundary |
| 1148 | |
| 1149 | if not self.nested and self.session.expire_on_commit: |
| 1150 | for s in self.session.identity_map.all_states(): |
| 1151 | s._expire(s.dict, self.session.identity_map._modified) |
| 1152 | |
| 1153 | statelib.InstanceState._detach_states( |
| 1154 | list(self._deleted), self.session |
| 1155 | ) |
| 1156 | self._deleted.clear() |
| 1157 | elif self.nested: |
| 1158 | parent = self._parent |
| 1159 | assert parent is not None |
| 1160 | parent._new.update(self._new) |
| 1161 | parent._dirty.update(self._dirty) |
| 1162 | parent._deleted.update(self._deleted) |
| 1163 | parent._key_switches.update(self._key_switches) |
| 1164 | |
| 1165 | @_StateChange.declare_states( |
| 1166 | (SessionTransactionState.ACTIVE,), _StateChangeStates.NO_CHANGE |
no test coverage detected