There was an error while loading. Please reload this page.
1 parent 6671ee2 commit 116d2c2Copy full SHA for 116d2c2
pymongo/client_session.py
@@ -216,14 +216,17 @@ def abort_transaction(self):
216
self._finish_transaction("abortTransaction")
217
218
def _finish_transaction(self, command_name):
219
+ self._check_ended()
220
+
221
if self._current_transaction_opts is None:
222
raise InvalidOperation("No transaction started")
223
- if self._server_session.statement_id == 0:
- # Not really started.
224
- return
225
-
226
try:
+ if self._server_session.statement_id == 0:
+ # Not really started.
227
+ self._server_session._transaction_id += 1
228
+ return
229
230
# TODO: retryable. And it's weird to pass parse_write_concern_error
231
# from outside database.py.
232
self._client.admin.command(
0 commit comments