(self)
| 192 | self._state = TransactionState.COMMITTED |
| 193 | |
| 194 | async def __rollback(self): |
| 195 | self.__check_state('rollback') |
| 196 | |
| 197 | if self._connection._top_xact is self: |
| 198 | self._connection._top_xact = None |
| 199 | |
| 200 | if self._nested: |
| 201 | query = 'ROLLBACK TO {};'.format(self._id) |
| 202 | else: |
| 203 | query = 'ROLLBACK;' |
| 204 | |
| 205 | try: |
| 206 | await self._connection.execute(query) |
| 207 | except BaseException: |
| 208 | self._state = TransactionState.FAILED |
| 209 | raise |
| 210 | else: |
| 211 | self._state = TransactionState.ROLLEDBACK |
| 212 | |
| 213 | @connresource.guarded |
| 214 | async def commit(self): |
no test coverage detected