File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 33
44from django .core .exceptions import ImproperlyConfigured
55from django .db .backends .base .base import BaseDatabaseWrapper
6+ from django .db .backends .utils import debug_transaction
67from django .utils .asyncio import async_unsafe
78from django .utils .functional import cached_property
89from pymongo .collection import Collection
@@ -194,21 +195,24 @@ def _commit(self):
194195 if not self .features .supports_transactions :
195196 return
196197 if self .session :
197- self .session .commit_transaction ()
198+ with debug_transaction (self , "session.commit_transaction()" ):
199+ self .session .commit_transaction ()
198200 self .session .end_session ()
199201 self .session = None
200202
201203 def _rollback (self ):
202204 if not self .features .supports_transactions :
203205 return
204206 if self .session :
205- self .session .abort_transaction ()
207+ with debug_transaction (self , "session.abort_transaction()" ):
208+ self .session .abort_transaction ()
206209 self .session = None
207210
208211 def _start_session (self ):
209212 if self .session is None :
210213 self .session = self .connection .start_session ()
211- self .session .start_transaction ()
214+ with debug_transaction (self , "session.start_transaction()" ):
215+ self .session .start_transaction ()
212216
213217 def _start_transaction_under_autocommit (self ):
214218 if not self .features .supports_transactions :
You can’t perform that action at this time.
0 commit comments