-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
Replication
-
ALL
I'm trying to test how drivers will handle error cases within multi-statement transactions. I perform the following with my prototype of PyMongo that supports transactions:
session = client.start_session() session.start_transaction() collection.insert_one({'_id': 1}, session=session) try: collection.insert_one({'_id': 1}, session=session) except Exception as exc: print(exc) collection.insert_one({'_id': 1}, session=session) session.commit_transaction()
It appears (based on debugging) that the transaction includes the document {_id: 1} after the first insert, and the second insert not only causes a duplicate key error, it also aborts the transaction. Therefore the third insert succeeds (outside of any transaction), and the commit_transaction fails with code 125, errmsg "Transaction isn't in progress."
- related to
-
SERVER-33432 Implicit transaction abort
- Closed
-
SERVER-34051 Require autocommit:false on all operations as part of an ongoing transaction
- Closed