(self)
| 173 | self.__check_state_base(opname) |
| 174 | |
| 175 | async def __commit(self): |
| 176 | self.__check_state('commit') |
| 177 | |
| 178 | if self._connection._top_xact is self: |
| 179 | self._connection._top_xact = None |
| 180 | |
| 181 | if self._nested: |
| 182 | query = 'RELEASE SAVEPOINT {};'.format(self._id) |
| 183 | else: |
| 184 | query = 'COMMIT;' |
| 185 | |
| 186 | try: |
| 187 | await self._connection.execute(query) |
| 188 | except BaseException: |
| 189 | self._state = TransactionState.FAILED |
| 190 | raise |
| 191 | else: |
| 192 | self._state = TransactionState.COMMITTED |
| 193 | |
| 194 | async def __rollback(self): |
| 195 | self.__check_state('rollback') |
no test coverage detected