MCPcopy Index your code
hub / github.com/MagicStack/asyncpg / __commit

Method __commit

asyncpg/transaction.py:175–192  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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')

Callers 2

__aexit__Method · 0.95
commitMethod · 0.95

Calls 2

__check_stateMethod · 0.95
executeMethod · 0.45

Tested by

no test coverage detected